Phiên bản API Đồ thị

Ads Pixel Shared Accounts

Đọc

Bạn không thể thực hiện thao tác này trên điểm cuối này.

Tạo

Bạn có thể tạo yêu cầu POST đến cạnh shared_accounts từ các đường dẫn sau:
When posting to this edge, no Graph object will be created.

Ví dụ

Graph API Explorer
POST /v19.0/{pixel-id}/shared_accounts HTTP/1.1
Host: graph.facebook.com

account_id=%7Bad-account-id%7D&business=%7Bbusiness-id%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{pixel-id}/shared_accounts',
    array (
      'account_id' => '{ad-account-id}',
      'business' => '{business-id}',
    ),
    '{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(
    "/{pixel-id}/shared_accounts",
    "POST",
    {
        "account_id": "{ad-account-id}",
        "business": "{business-id}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("account_id", "{ad-account-id}");
params.putString("business", "{business-id}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{pixel-id}/shared_accounts",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"account_id": @"{ad-account-id}",
  @"business": @"{business-id}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{pixel-id}/shared_accounts"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X POST \
  -F 'account_id={ad-account-id}' \
  -F 'business={business-id}' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v19.0/{pixel-id}/shared_accounts
Nếu bạn muốn tìm hiểu cách sử dụng API Đồ thị, hãy đọc Hướng dẫn sử dụng API Đồ thị của chúng tôi.

Thông số

Thông sốMô tả
account_id
numeric string

SELF_EXPLANATORY

Bắt buộc
business
numeric string or integer

SELF_EXPLANATORY

Bắt buộc

Kiểu trả về

Điểm cuối này hỗ trợ đọc sau khi ghi và sẽ đọc nút mà bạn đã đăng vào đó.
Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
368The action attempted has been deemed abusive or is otherwise disallowed
100Invalid parameter
190Invalid OAuth 2.0 Access Token
200Permissions error

Cập nhật

Bạn không thể thực hiện thao tác này trên điểm cuối này.

Xóa

Bạn có thể hủy liên kết an AdAccount khỏi an AdsPixel bằng cách thực hiện yêu cầu DELETE đến /{ads_pixel_id}/shared_accounts.

Thông số

Thông sốMô tả
account_id
numeric string

SELF_EXPLANATORY

Bắt buộc
business
numeric string or integer

SELF_EXPLANATORY

Bắt buộc

Kiểu trả về

Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
100Invalid parameter