เวอร์ชันของ API กราฟ

Ad Account, Assigned Users

การอ่าน

Business and system users assigned to this Ad Account.

ตัวอย่าง

Graph API Explorer
GET /v19.0/{ad-account-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(
    '/{ad-account-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(
    "/{ad-account-id}/assigned_users",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-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:@"/{ad-account-id}/assigned_users"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
หากคุณต้องการเรียนรู้วิธีใช้ API กราฟ โปรดอ่านคู่มือการใช้ API กราฟของเรา

พารามิเตอร์

พารามิเตอร์คำอธิบาย
business
numeric string or integer

The business associated with this Ad Account

ต้องระบุ

ช่อง

การอ่านจากจุดเชื่อมโยงนี้จะให้ผลลัพธ์ที่อยู่ในรูปแบบ JSON:

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

data

รายชื่อของโหนด AssignedUser

จะมีการเพิ่มช่องต่อไปนี้ลงในแต่ละโหนดที่ส่งกลับ:

ช่องคำอธิบาย
permitted_tasks
list<string>

Tasks that are assignable on this object

tasks
list<string>

All unpacked roles/tasks of this particular user on this object

paging

หากต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับการแบ่งหน้า โปรดดูคำแนะนำ API กราฟ

summary

ข้อมูลโดยรวมเกี่ยวกับจุดเชื่อมโยง เช่น จำนวนนับ ระบุช่องกรอกข้อมูลเพื่อดึงข้อมูลในพารามิเตอร์สรุป (เช่น summary=total_count)

ช่องคำอธิบาย
total_count
unsigned int32

Total number of business and system users assigned to this Ad Account

Error Codes

ข้อผิดพลาดคำอธิบาย
100Invalid parameter
190Invalid OAuth 2.0 Access Token
368The action attempted has been deemed abusive or is otherwise disallowed
2635You are calling a deprecated version of the Ads API. Please update to the latest version.
200Permissions error
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.

การสร้าง

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังอัพเดต

In v3.1 we introduce the new concept of task-based permissions to substitute for the current role-based permission. This affects access to ad accounts managed by Business Manager API and Pages. Role-based access to ad accounts and Pages is still available but will be deprecated in the future. This impacts the following roles and provides the equivalent tasks for ad accounts:

  • Role: ADMIN, Tasks: ['MANAGE', 'ADVERTISE', 'ANALYZE' - Manage all aspects of ad campaigns, reporting, billing and ad account permissions.
  • Role: GENERAL_USER, Tasks: ['ADVERTISE', 'ANALYZE'] - Create ads using the funding source associated with the ad account. Run reports.
  • Role: GENERAL_USER, Tasks: ['ANALYZE'] - Run reports.

This replaces the following roles in Business Manager API with these tasks:

  • Role: MANAGER, Tasks: ['MANAGE', 'CREATE_CONTENT', 'MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: CONTENT_CREATOR, Tasks: ['CREATE_CONTENT', 'MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: MODERATOR, Tasks: ['MODERATE', 'ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: ADVERTISER, Tasks: ['ADVERTISE', 'ANALYZE', 'DRAFT']
  • Role: INSIGHTS_ANALYST, Tasks: ['ANALYZE', 'DRAFT']
  • Role: CREATIVE_HUB_MOCKUPS_MANAGER, Tasks: ['DRAFT']
คุณสามารถอัพเดต an AdAccount ได้โดยส่งคำขอ POST ไปที่ /act_{ad_account_id}/assigned_users

พารามิเตอร์

พารามิเตอร์คำอธิบาย
tasks
array<enum {MANAGE, ADVERTISE, ANALYZE, DRAFT, AA_ANALYZE}>

AdAccount permission tasks to assign this user

user
UID

Business user id or system user id

ต้องระบุ

ประเภทการส่งกลับ

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Error Codes

ข้อผิดพลาดคำอธิบาย
100Invalid parameter
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
2620Invalid call to update account permissions
190Invalid OAuth 2.0 Access Token
2635You are calling a deprecated version of the Ads API. Please update to the latest version.

กำลังลบ

You can dissociate a User from an AdAccount by making a DELETE request to /act_{ad_account_id}/assigned_users.

พารามิเตอร์

พารามิเตอร์คำอธิบาย
user
UID

Business user id or system user id

ต้องระบุ

ประเภทการส่งกลับ

Struct {
success: bool,
}

Error Codes

ข้อผิดพลาดคำอธิบาย
3919There was an unexpected technical issue. Please try again.
368The action attempted has been deemed abusive or is otherwise disallowed
100Invalid parameter
457The session has an invalid origin
190Invalid OAuth 2.0 Access Token