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

Page Agencies

การอ่าน

Returns the Businesses and Agencies that have permissions on the page.

ประสบการณ์เพจแบบใหม่

This endpoint is supported for ประสบการณ์เพจแบบใหม่.

Requirements

  • A Page access token requested by a person who can perform the MANAGE task on the Page.
  • The business_management permission for Pages owned or claimed by a business, otherwise the pages_manage_metadata and page_show_list permissions.

ตัวอย่าง

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

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ช่อง

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

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

data

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

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

ช่องคำอธิบาย
access_requested_time
datetime

The creation time of the access request

access_status
enum

The status of the access request

access_updated_time
datetime

The update time of the access request

permitted_tasks
list<string>

The permissions of tasks associated with the access request

paging

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

Error Codes

ข้อผิดพลาดคำอธิบาย
100Invalid parameter
190Invalid OAuth 2.0 Access Token

การสร้าง

You can make a POST request to agencies edge from the following paths:
When posting to this edge, no Graph object will be created.

พารามิเตอร์

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

The business ID of the agency that you want to assign to this Page.

ต้องระบุ
permitted_tasks
array<enum {MANAGE, CREATE_CONTENT, MODERATE, MESSAGING, ADVERTISE, ANALYZE, MODERATE_COMMUNITY, MANAGE_JOBS, PAGES_MESSAGING, PAGES_MESSAGING_SUBSCRIPTIONS, READ_PAGE_MAILBOXES, VIEW_MONETIZATION_INSIGHTS, MANAGE_LEADS, PROFILE_PLUS_FULL_CONTROL, PROFILE_PLUS_MANAGE, PROFILE_PLUS_FACEBOOK_ACCESS, PROFILE_PLUS_CREATE_CONTENT, PROFILE_PLUS_MODERATE, PROFILE_PLUS_MODERATE_DELEGATE_COMMUNITY, PROFILE_PLUS_MESSAGING, PROFILE_PLUS_ADVERTISE, PROFILE_PLUS_ANALYZE, PROFILE_PLUS_REVENUE, PROFILE_PLUS_MANAGE_LEADS, CASHIER_ROLE}>

Tasks that are assignable to this Page.

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

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

Error Codes

ข้อผิดพลาดคำอธิบาย
200Permissions error
3989You are trying to assign a duplicated asset to this agency.
368The action attempted has been deemed abusive or is otherwise disallowed
100Invalid parameter
3946Asset already belongs to this Business Manager.
190Invalid OAuth 2.0 Access Token
80001There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.

กำลังอัพเดต

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

กำลังลบ

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