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

User Accounts

The Facebook Pages that a person owns or is able to perform tasks on.

การอ่าน

Pages the User has a role on

Permissions

A Page access token for a User with a role (other than Live Contributor) on the Page and the following permissions:

  • The pages_show_list permission
  • To access accounts using a business_id or for a user who owns any business Pages, the app must be approved for the business_management permission.

Note: In order for a Page to be returned, the User must also grant the app running the query the pages_show_list permissions for that Page.

Limitations

  • It does not return pages that you are connected with through a business. To retrieve pages that you are connected with via businesses, the business_management permission is required

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

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

ตัวอย่าง

Graph API Explorer
GET /v19.0/{user-id}/accounts 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(
    '/{user-id}/accounts',
    '{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(
    "/{user-id}/accounts",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}/accounts",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{user-id}/accounts"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X GET -G \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v19.0/{user-id}/accounts
หากคุณต้องการเรียนรู้วิธีใช้ API กราฟ โปรดอ่านคู่มือการใช้ API กราฟของเรา

พารามิเตอร์

พารามิเตอร์คำอธิบาย
is_place
boolean

If specified,filter pages based on whetherthey are places or not

is_promotable
boolean

If specified, filter pages based on whether they can be promoted or not

ช่อง

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

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

data

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

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

ช่องคำอธิบาย
tasks
list<enum>

The User's tasks assigned to the Page.

paging

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

summary

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

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

Total number of objects on this edge

Error Codes

ข้อผิดพลาดคำอธิบาย
459The session is invalid because the user has been checkpointed
190Invalid OAuth 2.0 Access Token
100Invalid parameter
200Permissions error
368The action attempted has been deemed abusive or is otherwise disallowed
104Incorrect signature
80002There have been too many calls to this Instagram account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
2500Error parsing graph query
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.
210User not visible

การสร้าง

This API lets you create Facebook pages.

Permissions

  • A User access token with pages_manage_metadata and pages_show_list permissions.
  • The category_enum parameter with a Page Category.
  • Other requirements vary depending on the type of page you are creating but may require the following parameters: name, about, picture, and cover_photo.

Note: When setting the locale, at least one, city_id, location, or coordinates, is required. Caveats:

  • city_id and location can not be used together
  • city_id and coordinates can be used together however the coordinates must be within the city selected
  • location and coordinates can be used together however the coordinates must be within the location selected

Limitations

  • You can only create a Page as a test user or if your app has been allowlisted by your Facebook representative.

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

พารามิเตอร์

พารามิเตอร์คำอธิบาย
about
UTF-8 encoded string

Short description

address
UTF-8 encoded string

Address

category_enum
string

Page category (enum). See Pages Categories API docs.

category_list
list<numeric string>

List of categories

city_id
city id

City ID

coordinates
JSON-encoded coordinate list

Coordinates

cover_photo
Object

Cover photo

url
URL

ต้องระบุ
offset_y
integer
ค่าเริ่มต้น: 50

offset_x
integer
ค่าเริ่มต้น: 50

focus_y
float

focus_x
float

zoom_scale_x
float

zoom_scale_y
float

no_feed_story
boolean
ค่าเริ่มต้น: false

no_notification
boolean
ค่าเริ่มต้น: false

description
UTF-8 encoded string

Description

ignore_coordinate_warnings
boolean

If ignore warnings generated in coordination validation (bool)

location
Object

This defines the location for this page. This is required if location_page_id is not specified, or if the Page referenced by the location_page_id doesn't have a valid value for the field. The dictionary must include the keys either city_id or all of city, state, and country (but state is optional if the address is not in the U.S.).

city
string

state
string

country
string

name
UTF-8 encoded string

Page name

ต้องระบุ
phone
UTF-8 encoded string

Phone

picture
URL

Profile picture

website
URL

Website

zip
string

Zipcode

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

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Error Codes

ข้อผิดพลาดคำอธิบาย
200Permissions error
100Invalid parameter
152Invalid page type
194Missing at least one required parameter
368The action attempted has been deemed abusive or is otherwise disallowed

กำลังอัพเดต

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

กำลังลบ

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