圖形 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

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

summary

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

欄位說明
total_count
unsigned int32

Total count

Error Codes

錯誤說明
100Invalid parameter
200Permissions error

建立中

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

更新中

你可以向 /{whats_app_business_account_id}/assigned_users 提出發佈要求,以更新 a WhatsAppBusinessAccount

參數

參數說明
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

必填

傳回類型

此端點支援寫入後讀取功能,並將讀取你傳送 POST 的節點。
Struct {
success: bool,
}

Error Codes

錯誤說明
100Invalid parameter
200Permissions error

刪除中

你可以向 /{whats_app_business_account_id}/assigned_users 提出刪除要求,中斷 a WhatsAppBusinessAccount 和 a WhatsAppBusinessAccount 的關聯。

參數

參數說明
user
UID

Business user ID

必填

傳回類型

Struct {
success: bool,
}

Error Codes

錯誤說明
100Invalid parameter
200Permissions error