Features of the CheckWhatsap method with numbers of some countries#
Contents
1. Canada and US Numbers#
All Canadian and US numbers are in the format 1ХХХХХХХХХХ.
When replacing the first digit "1" with values equal to "10", "100", "1000" and "10000" (in the formats 10ХХХХХХХХХХХ, 100ХХХХХХХХХХХ, etc.), the CheckWhatsap method may return an unreliable result:
- The method will return
"existsWhatsapp": true
in the response body, but the message sent to the incorrectly recorded number (with extra zeros) will get stuck in the sending queue and will not be sent.
How to get a reliable result:
- In the integration, before checking numbers of 12 or more digits, automatically remove zeros after "1" at the beginning of the number.
Convert number like
1002123456789
to12123456789
for sending messages.
Required number format for sending messages 12123456789@c.us
2. Numbers of Kazakhstan and Russia#
All numbers of Kazakhstan and Russia have the format 7ХХХХХХХХХХ.
When checking a number without a country code (in the format ХХХХХХХХХХХ), the CheckWhatsap method may return an unreliable result:
-
If a Russian/Kazakh number is connected to the instance, the method will return the response
"existsWhatsapp": true
, since WhatsApp will automatically add "7" to the number. -
If a number from other countries is connected to the instance, the method will return the response
"existsWhatsapp": false
, since WhatsApp will identify the number as foreign and will not add "7".
How to get a reliable result:
- In the integration, before checking ten-digit numbers, automatically add the digit "7" to the beginning of the number.
Convert a number like
7473456789
to77473456789
to send messages.
- Check Russian/Kazakh numbers from numbers from other countries.
Required number format for sending messages 79876543210@c.us
3. Mexico numbers#
All Mexican numbers have the format 52ХХХХХХХХХ or 521ХХХХХХХХХХ.
In some Mexican numbers, the number "1" must be inserted between the country code "52" and the city code (also for the Nextel operator).
You don't need to add the digit "1" in the following cases:
- For landline numbers (e.g. fixed-line numbers)
- Mobile numbers that previously didn't require adding the digit "1" (This rule applies to some mobile operators)
History of the issue
Previously, calling mobile phones in Mexico required adding the digit "1" after the country code for international calls. This rule remains in WhatsApp for numbers that are classified as mobile.
When checking a number, the CheckWhatsap method may return an invalid result:
- If the number should contain "1" after the country code, but the digit is missing in the request, the method will return
"existsWhatsapp": true
in the response body. A message sent to an incorrectly written number (without "1") will be stuck in the sending queue and will not be sent. - If the number should not contain "1" after the country code, but the number is present in the request, the method will return
"existsWhatsapp": true
in the response body. A message sent to an incorrectly written number (with "1") will be stuck in the sending queue and will not be sent.
You can check the correctness of the number using the request https://wa.me/5210123456789. Regardless of adding the number "1", WhatsApp will redirect to the correct number.
- Number 523345678910 when going to https://wa.me/5213345678910 with the addition of 1 transfers to the chat with account 523345678910, that is, the correct number is 523345678910.
- Number 5213323456789, regardless of adding 1 when going to the direct link https://wa.me/5213323456789, the redirect will be to the chat with the number 5213323456789.
We recommend checking the correct chatID through the methods of journals or the method GetContacts
Required number format for sending messages 520123456789@c.us or 5210123456789@c.us