To use your business phone number with Cloud API you must register it. Register your business phone number in the following scenarios:
Before you can register your business phone number you must first verify its ownership.
If you are migrating a phone number from the On-Premises API to the Cloud API, there are extra steps you need to perform before registering a phone number with the Cloud API. See Migrate From On-Premises API to Cloud API for the full process.
To register your verified business phone number, make a POST
call to PHONE_NUMBER_ID/register
. Include the parameters listed below.
Endpoint | Authentication |
---|---|
(See Get Phone Number ID) |
Solution Partners must authenticate themselves with an access token with the |
Requests to the registration endpoint are limited to 10 requests per business number in a 72 hour moving window.
When you make a registration request, we will check how many registration requests you have made to register that number in the last 72 hours. If you have already made 10 requests, the API will return error code 133016
, and the number will be prevented from being registered for the next 72 hours.
Name | Description |
---|---|
| Required. Messaging service used. Set this to |
| Required. If your verified business phone number already has two-step verification enabled, set this value to your number's 6-digit two-step verification PIN. If you cannot recall your PIN, you can update it. If your verified business phone number does not have two-step verification enabled, set this value to a 6-digit number. This will be the newly verified business phone number's two-step verification PIN. |
| Optional. If included, enables local storage on the business phone number. Value must be a 2-letter ISO 3166 country code (e.g. Supported values: APAC
Europe
LATAM
MEA
NORAM
Once enabled, cannot be disabled or changed directly. Instead, you must deregister the number and register it again without this parameter (to disable), or include the parameter with the new country code (to change). To enable local storage on a number that has already been registered, you must deregister the number, then register it again and include this parameter. |
curl 'https://graph.facebook.com/v21.0
/106540352242922/register ' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"pin": "212834"
}
curl 'https://graph.facebook.com/v21.0
/106540352242922/register ' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"pin": "212834",
"data_localization_region": "CH"
}
All API calls require authentication with access tokens.
Developers can authenticate their API calls with the access token generated in the App Dashboard > WhatsApp > API Setup.
Solution Partners must authenticate themselves with an access token with the whatsapp_business_messaging
and whatsapp_business_management
permissions. See System User Access Tokens for information.
Deregistering a business phone number makes it no longer usable with Cloud API and disables local storage on the number, if it had been enabled.
Deregistration does not delete a number or its message history. To delete a number and its history, see Delete Phone Number from a WABA.
To deregister a business phone number , make a POST
call to PHONE_NUMBER_ID/deregister
:
Endpoint | Authentication |
---|---|
(See Get Phone Number ID) |
Solution Partners must authenticate themselves with an access token with the |
Requests to the deregistration endpoint are limited to 10 requests per business number in a 72 hour moving window.
When you make a deregistration request, we will check how many deregistration requests you have made to deregister that number in the last 72 hours. If you have already made 10 requests, the API will return error code 133016
, and the number will be prevented from being deregistered for the next 72 hours.
Sample Request:
curl -X POST \
'https://graph.facebook.com/v21.0
/FROM_PHONE_NUMBER_ID/deregister' \
-H 'Authorization: Bearer ACCESS_TOKEN'
A successful response looks like:
{ "success": true }