图谱 API 版

Whats App Business Account Phone Numbers

Represents a collection of business phone numbers associated with a WhatsApp Business Account (WABA).

如要获取 WhatsApp Business 商业帐号的编号,请前往商务管理平台 > 商业设置 > 帐号 > WhatsApp Business 商业帐号。找到您要使用的帐号,然后点击该帐号。系统随后将开启一个窗口,其中包含该帐号的编号等相关信息。

For more information on how to use the API, see WhatsApp Business Management API.

读取

你无法在此端点执行该操作。

创建

Create a business phone number on a WhatsApp Business Account.

Requirements

Sample Request

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
}];

Sample Response

{
  "id": "POST-ID"
}
你可以通过下列路径向 phone_numbers 连线发出 POST 请求:
发布到这个连线会创建 a WhatsAppBusinessPhoneNumber

参数

参数描述
cc
string

Country dial code of the phone number (for example, 1).

migrate_phone_number
boolean

Set to true to migrate a registered WhatsApp Business Phone Number from one WhatsApp Business Account to another.

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 代表的节点。
Struct {
id: numeric string,
}

错误代码

错误描述
100Invalid parameter
200Permissions error

更新

你无法在此端点执行该操作。

删除

你无法在此端点执行该操作。