图谱 API 版

Instagram Business Asset Agencies

读取

Returns the Businesses and Agencies that have permissions on the Instagram Business Asset

Requirements

  • The business_management permission for the business that owns the Instagram Business Asset

例子

Graph API Explorer
GET /v25.0/{instagram-business-asset-id}/agencies 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}/agencies',
    '{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}/agencies",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{instagram-business-asset-id}/agencies",
    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}/agencies"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果你希望详细了解如何使用图谱 API,请阅读我们的图谱 API 指南

参数

这个端点不包含任何参数。

字段

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

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

data

Business 节点列表。

paging

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

创建

Giving an agency access to an Instagram business asset lets them work on tasks you assign to them, including using APIs to manage tasks. The Instagram business asset will remain in your portfolio.

你可以通过下列路径向 agencies 连线发出 POST 请求:
When posting to this edge, no Graph object will be created.

参数

参数描述
business
numeric string

The business ID of the agency that you want to assign to this Instagram Business Asset

必填
permitted_tasks
array<enum {CONTENT, MESSAGES, COMMUNITY_ACTIVITY, ADVERTISE, ANALYZE}>

Tasks that you want to assign to the agency

必填

返回类型

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

错误代码

错误描述
100Invalid parameter

更新

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

删除

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

参数

参数描述
business
numeric string

The business ID of the agency that you want to revoke access for the Instagram Business Asset

必填

返回类型

Struct {
success: bool,
}