What are the features of sending and receiving messages to numbers of different countries?#
Contents#
- Russian Federation numbers
- Kazakhstan numbers
- Mexico numbers
- Argentina numbers
- Brazil numbers
- USA numbers
- Canada numbers
1. Russian Federation numbers#
All Russian numbers should have the country code "7".
When specifying the code 8 in the number:
- messages sent via API will be sent to a non-existent account.
- messages sent via WhatsApp will be automatically forwarded to the existing account 79876543210.
As a result, the phone number will include 11 digits: 7XXXXXXXXXX.
You can check the correctness of the number using the request https://wa.me/79876543210.
The required number format for sending messages is 79876543210@c.us
2. Kazakhstan numbers#
All Kazakhstan numbers should have the country code "7".
When specifying the code 8 in the number:
- messages sent via API will be sent to a non-existent account,
- messages sent via WhatsApp will be automatically forwarded to the existing account 77473456789.
As a result, the phone number will include 11 digits: 7XXXXXXXXXX.
You can check the correctness of the number using the request https://wa.me/7777777777.
Required number format for sending messages 77473456789@c.us
3. Mexico Numbers#
All Mexico numbers should have the country code "52".
Some numbers require a "1" between the country code "52" and the area code.
Adding the "1" is not required in the following cases:
- For landline numbers (e.g. fixed-line numbers)
- Mobile numbers that previously did not require the "1" to be added (This rule applies to some mobile operators)
As a result, the phone number will include 12 or 13 digits:
52ХХХХХХХХХХХ or 521ХХХХХХХХХХХ.
You can check the correctness of the number using the request https://wa.me/5210123456789. Regardless of adding the number "1" to the number, 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
4. Argentina Numbers#
All Argentina numbers should have the country code "54".
All Argentine phone numbers should have a "9" between the country code "54" and the city code.
The "15" code at the beginning should be removed.
As a result, the phone number will include 13 digits: 549XXXXXXXXXX.
You can check the correctness of the number using the request https://wa.me/5490123456789
Required number format for sending messages 5490123456789@c.us
5. Brazilian Numbers#
All Brazilian numbers should have the country code "55".
In some regions of Brazil, the number "9" is added between the local phone number and the Brazilian area code.
The list of area codes to which the number 9 should be added: 11-19, 21, 22, 24, 27, 28.
For Brazilian numbers with other area codes, the number 9 should be omitted.
As a result, the phone number can include 12 or 13 digits:
55219XXXXXXXX or 5521XXXXXXXX.
You can check the correctness of the number using the request https://wa.me/552112345678
Required number for sending messages:
552112345678@c.us or 5521912345678@c.us
Python code example
Install the package
```
pip install phonenumbers
```
```python
import phonenumbers
# is the only areas that whatspp updated for 9h digit
UPDATED_AREA_CODE = {"55": ["11", "12", "13", "14", "15", "16", "17", "18", "19", "21", "22", "24", "27", "28"]}
def prepare_whatsapp_number(phone):
x = phonenumbers.parse(phone, None)
country_code = str(x.country_code)
area_code = str(x.national_number)[0:2]
phone = phone.replace('+','')
updated_area = UPDATED_AREA_CODE
if updated_area.get(country_code):
area_code_updated = updated_area[country_code]
# Remove or add the 9h digit for states that were not updated
if area_code not in area_code_updated:
if len(str(x.national_number)) == 11:
phone = '%s%s%s' % (country_code, area_code, str(x.national_number)[3:])
else:
if len(str(x.national_number)) == 10:
phone = '%s%s%s%s' % (country_code, area_code,"9", str(x.national_number)[2:])
return phone
print(prepare_whatsapp_number("+559212345678"))
print(prepare_whatsapp_number("+5592912345678")) #phone number not working
```
6. USA numbers#
All USA numbers should have the country code "1".
All numbers after the country code "1" have the state code.
As a result, the phone number will include 11 digits: 1ХХХХХХХХХХ
You can check the correctness of the number using the request https://wa.me/12123456789
Required number format for sending messages 12123456789@c.us
6. Canada numbers#
All Canada numbers should have the country code "1".
All numbers after the country code "1" have the state code.
As a result, the phone number will include 11 digits: 1ХХХХХХХХХХ
You can check the correctness of the number using the request https://wa.me/12123456789
Required number format for sending messages 12123456789@c.us