Phiên bản API Đồ thị

Business Client Whatsapp Business Accounts

Đọc

Get a list of WhatsApp Business Accounts on a Business.

Example

Requirements

  • whatsapp_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/client_whatsapp_business_accounts' \
-H 'Authorization: Bearer USER-ACCESS-TOKEN'
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/BUSINESS-ID/client_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/client_whatsapp_business_accounts"
           parameters:nil
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];

Response

{
  "data": [
  ]
}

Request with Filtering

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

Thông số

Điểm cuối này không có bất kỳ thông số nào.

Trường

Đọc từ cạnh này sẽ trả về một kết quả JSON đã định dạng:

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

data

Danh sách nút WhatsAppBusinessAccount.

Các trường sau sẽ được thêm vào mỗi nút trả về:

TrườngMô tả
permitted_tasks
list<string>

Tasks that are assignable to users on this asset

paging

Để biết thêm chi tiết về chia trang, hãy xem hướng dẫn về API Đồ thị.

Mã lỗi

LỗiMô tả
368The action attempted has been deemed abusive or is otherwise disallowed
200Permissions error
190Invalid OAuth 2.0 Access Token
100Invalid parameter
104Incorrect signature

Tạo

Bạn không thể thực hiện thao tác này trên điểm cuối này.

Cập nhật

Bạn không thể thực hiện thao tác này trên điểm cuối này.

Xóa

Bạn không thể thực hiện thao tác này trên điểm cuối này.