Версия API Graph

Business Owned Whatsapp Business Accounts

Represents a collection of WhatsApp Business Accounts owned by a business.

To find the ID of a business, go to Business Manager > Business Settings > Business Info. There, you will see information about the business, including the ID.

Чтение

Get a list of WhatsApp Business Accounts owned by this business. Supports filtering and sorting.

Example

Requirements

  • whatsapp_business_management permission

  • business_management permission

  • whatsapp_business_messaging permission

  • public_profile permission

  • BUSINESS ID (also referred to as BUSINESS MANAGER ID in Business Settings)

  • ADMIN SYSTEM USER ACCESS TOKEN for the business

Request

curl -i -X GET \
'https://graph.facebook.com/LATEST-VERSION/BUSINESS-ID/owned_whatsapp_business_accounts' \
 -H 'Authorization: Bearer USER-ACCESS-TOKEN'
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/BUSINESS-ID/owned_whatsapp_business_accounts",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/BUSINESS-ID/owned_whatsapp_business_accounts"
           parameters:nil
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];

Response

{
  "data": [
    {
      "id": "WHATSAPP-BUSINESS-ACCOUNT-ID",
      "name": "Test WhatsApp Business Account",
      "timezone_id": "1",
      "message_template_namespace": "MESSAGE-TEMPLATE-NAMESPACE"
    }
  ],
  "paging": {
    "cursors": {
      "before": "BEFORE-CURSOR",
      "after": "AFTER-CURSOR"
    }
  }
}

Request with Filtering

curl -i -X GET \
"https://graph.facebook.com/LATEST-VERSION/BUSINESS-ID/owned_whatsapp_business_accounts \
?fields=id,name,creation_time \
&filtering=[{'field':'creation_time', 'operator': 'IN_RANGE', 'value': ['1569783261', '1604542049']}]"
 -H 'Authorization: Bearer USER-ACCESS-TOKEN'

Параметры

Эта конечная точка не содержит параметров.

Поля

При чтении с данной границы контекста будет возвращен результат в формате JSON:

{ "data": [], "paging": {} }

data

Список узлов «WhatsAppBusinessAccount».

paging

Для получения дополнительных сведений о пагинации смотрите Руководство по API Graph.

Error Codes

ОшибкаОписание
200Permissions error
190Invalid OAuth 2.0 Access Token
104Incorrect signature

Создание

Нельзя выполнить эту операцию в этой конечной точке.

Обновление

Нельзя выполнить эту операцию в этой конечной точке.

Удаление

Нельзя выполнить эту операцию в этой конечной точке.