Graph API 版本

Whats App Business Account Assigned Users

Represents users assigned to a specific WhatsApp Business Account (WABA).

如要獲取 WhatsApp Business 帳戶的編號,請前往企業管理平台 > 企業管理平台設定 > 帳戶 > WhatsApp Business 帳戶。找出您要使用的帳戶,然後點擊該帳戶。系統會隨即開啟一個面板,其中包含該帳戶的編號等相關資訊。

閱讀中

Returns the WhatsApp Business Account's assigned users.

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)

  • WhatsApp Business Account (WABA) ID

  • USER ACCESS TOKEN

Request

curl -i -X GET \
 "https://graph.facebook.com/LATEST-VERSION/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users?
        business=BUSINESS-ID&
        access_token=USER-ACCESS-TOKEN"
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

Bundle parameters = new Bundle();
parameters.putString("business", "BUSINESS-ID");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users"
           parameters:@{ @"business": @"BUSINESS-ID",}
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];

Response

{
  "data": [
    {
      "id": "ASSIGNED-USER-ID",
      "name": " ",
      "tasks": [
        "MANAGE"
      ]
    }
  ],
  "paging": {
    "cursors": {
      "before": "BEFORE-CURSOR",
      "after": "AFTER-CURSOR"
    }
  }
}

參數

參數描述
business
numeric string

business

必填

欄位

由此關係連線進行的閱讀將回傳 JSON 格式結果:

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

data

AssignedUser 節點的清單。

將在每個傳回的節點新增以下欄位:

欄位說明
tasks
list<string>

Tasks the user has on the WABA

paging

如需更多有關分頁的詳細資料,請參閱 Graph API 指南

summary

與關係連線相關的彙總資訊,例如次數等。請在摘要參數中指定要擷取的欄位(例如 summary=total_count)。

欄位說明
total_count
unsigned int32

Total count

Error Codes

錯誤說明
100Invalid parameter
200Permissions error

建立中

你無法在此端點執行此操作。

更新中

You can update a WhatsAppBusinessAccount by making a POST request to /{whats_app_business_account_id}/assigned_users.

參數

參數描述
tasks
array<enum {MANAGE, DEVELOP, MANAGE_TEMPLATES, MANAGE_PHONE, VIEW_COST, MANAGE_EXTENSIONS, VIEW_PHONE_ASSETS, MANAGE_PHONE_ASSETS, VIEW_TEMPLATES, MESSAGING}>

Permissions on WhatsApp Business Account

必填
user
UID

Business user ID

必填

傳回類型

This endpoint supports 寫入後讀取 and will read the node to which you POSTed.
Struct {
success: bool,
}

Error Codes

錯誤說明
100Invalid parameter
200Permissions error

正在刪除

You can dissociate a WhatsAppBusinessAccount from a WhatsAppBusinessAccount by making a DELETE request to /{whats_app_business_account_id}/assigned_users.

參數

參數描述
user
UID

Business user ID

必填

傳回類型

Struct {
success: bool,
}

Error Codes

錯誤說明
100Invalid parameter
200Permissions error