The Facebook Pages that a person owns or is able to perform tasks on.
Pages the User has a role on
GET /v24.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
}];このエッジからの読み込むではJSONフォーマットの結果が返されます:
{ "
data": [], "paging": {}, "summary": {} }
pagingsummaryエッジの集計情報(数値など)。サマリーパラメータで取得するフィールドを指定します(サマリー=total_countなど)。
| フィールド | 説明 |
|---|---|
total_countint32 | Total number of objects on this edge |
| エラー | 詳細 |
|---|---|
| 459 | The session is invalid because the user has been checkpointed |
| 190 | Invalid OAuth 2.0 Access Token |
| 200 | Permissions error |
| 100 | Invalid parameter |
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 80001 | There 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. |
| 80002 | There 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. |
| 483 | The session is invalid because the user is in consent app blocking |
| 283 | That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata |
| 2500 | Error parsing graph query |
This API lets you create Facebook pages.
pages_manage_metadata and pages_show_list permissions.category_enum parameter with a Page Category.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 togethercity_id and coordinates can be used together however the coordinates must be within the city selectedlocation and coordinates can be used together however the coordinates must be within the location selectedaccountsのエッジにPOSTリクエストを以下のパスで送信できます: | パラメーター | 説明 |
|---|---|
aboutUTF-8 encoded string | Short description |
addressUTF-8 encoded string | Address |
category_enumstring | Page category (enum). See Pages Categories API docs. |
category_listlist<numeric string> | List of categories |
city_idcity id | City ID |
coordinatesJSON-encoded coordinate list | Coordinates |
cover_photoObject | Cover photo |
urlURL | 必須 |
offset_yinteger | デフォルト値: 50 |
offset_xinteger | デフォルト値: 50 |
focus_yfloat | |
focus_xfloat | |
zoom_scale_xfloat | |
zoom_scale_yfloat | |
no_feed_storyboolean | デフォルト値: false |
no_notificationboolean | デフォルト値: false |
descriptionUTF-8 encoded string | Description |
ignore_coordinate_warningsboolean | If ignore warnings generated in coordination validation (bool) |
locationObject | This defines the location for this page. This is required if |
citystring | |
statestring | |
countrystring | |
nameUTF-8 encoded string | Page name 必須 |
phoneUTF-8 encoded string | Phone |
pictureURL | Profile picture |
websiteURL | Website |
zipstring | Zipcode |
idによって表されたノードを戻り値の型で読み込みます。id: numeric string, | エラー | 詳細 |
|---|---|
| 100 | Invalid parameter |
| 200 | Permissions error |
| 152 | Invalid page type |
| 194 | Missing at least one required parameter |
| 283 | That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata |