图谱 API 版

Instagram Business Asset Assigned Users

读取

Get a list of business users and their permissions tasks for this Instagram Business Asset

例子

Graph API Explorer
GET /v26.0/{instagram-business-asset-id}/assigned_users HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{instagram-business-asset-id}/assigned_users',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{instagram-business-asset-id}/assigned_users",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{instagram-business-asset-id}/assigned_users",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{instagram-business-asset-id}/assigned_users"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果你希望详细了解如何使用图谱 API,请阅读我们的图谱 API 指南

参数

参数描述
business
numeric string

business

必填

字段

从这条连线读取将返回一个 JSON 格式的结果:

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

data

AssignedUser 节点列表。

以下字段将添加到返回的每个节点:

字段说明
tasks
list<string>

tasks

paging

详细了解分页功能,请见图谱 API 指南

错误代码

错误描述
100Invalid parameter

创建

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

更新

你可以向 /{instagram_business_asset_id}/assigned_users 发出 POST 请求,以更新 an AssignedUser

参数

参数描述
tasks
array<enum {CONTENT, MESSAGES, COMMUNITY_ACTIVITY, ADVERTISE, ANALYZE}>

Instagram Business Asset tasks to assign to user

user
UID

Business user

必填

返回类型

这个端点支持先写后读,并会读取接收你的 POST 请求的节点。
Struct {
success: bool,
}

错误代码

错误描述
100Invalid parameter

删除

你可以向 /{instagram_business_asset_id}/assigned_users 发出 DELETE 请求,将 an AssignedUser 与 an InstagramBusinessAsset 取消关联。

参数

参数描述
user
UID

user

必填

返回类型

Struct {
success: bool,
}