Represents a collection of business phone numbers associated with a WhatsApp Business Account (WABA).
For more information on how to use the API, see WhatsApp Business Management API .
Type | Description |
---|---|
User or System User . |
|
curl -i -X POST \
"https://graph.facebook.com/LATEST-VERSION/WHATSAPP-BUSINESS-ACCOUNT-ID/phone_numbers?
cc=COUNTRY-CODE&
phone_number=PHONE-NUMBER&
migrate_phone_number=true&
access_token=USER-ACCESS-TOKEN"
GraphRequest request = GraphRequest.newPostRequest(
accessToken,
"/WHATSAPP-BUSINESS-ACCOUNT-ID/phone_numbers",
new JSONObject("{\"cc\":\"COUNTRY-CODE\",\"phone_number\":\"PHONE-NUMBER\",\"migrate_phone_number\":true}"),
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
// Insert your code here
}
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/WHATSAPP-BUSINESS-ACCOUNT-ID/phone_numbers"
parameters:@{ @"cc": @"COUNTRY-CODE",@"phone_number": @"PHONE-NUMBER",@"migrate_phone_number": @"true",}
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
}];
{ "id": "POST-ID" }
phone_numbers
edge from the following paths:
Parameter | Description |
---|---|
cc
string
|
Country dial code of the phone number (for example, |
migrate_phone_number
boolean
|
Set to |
phone_number
string
|
Phone number without the country code or plus symbol ( |
preverified_id
string
|
Preverified ID related to this phone number |
verified_name
string
|
Name of the business as it appears in the WhatsApp app or WhatsApp Business app profile. |
id
in the return type.id
: numeric string,Error | Description |
---|---|
100 | Invalid parameter |
300 | Edit failure |
200000 | Cannot add phone number to WhatsApp Business Account |
200 | Permissions error |