图谱 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

关于连线的汇总信息(例如次数总计)。请指定字段来调取概要中的参数(例如:概要=total_count)。

字段说明
total_count
unsigned int32

Total count

错误代码

错误描述
100Invalid parameter

创建

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

更新

你可以向 /{whats_app_business_account_id}/assigned_users 发出 POST 请求,以更新 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,
}

错误代码

错误描述
100Invalid parameter
200Permissions error
80008There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.

删除

你可以向 /{whats_app_business_account_id}/assigned_users 发出 DELETE 请求,将 a WhatsAppBusinessAccount 与 a WhatsAppBusinessAccount 取消关联。

参数

参数描述
user
UID

Business user ID

必填

返回类型

Struct {
success: bool,
}

错误代码

错误描述
100Invalid parameter