图谱 API 版

Permission

读取

A permission requested from a user by an application

例子

Graph API Explorer
GET v19.0/...?fields={fieldname_of_type_Permission} 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(
    '...?fields={fieldname_of_type_Permission}',
    '{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(
    "...?fields={fieldname_of_type_Permission}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "...?fields={fieldname_of_type_Permission}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"...?fields={fieldname_of_type_Permission}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果你希望详细了解如何使用图谱 API,请阅读我们的图谱 API 指南

参数

这个端点不包含任何参数。

字段

字段描述
permission
string

Name of the permission

status
enum

Permission status

创建

你无法在此端点执行该操作。

更新

你无法在此端点执行该操作。

删除

你可以向 /{user_id}/permissions 发出 DELETE 请求,将 a Permission 与 a User 取消关联。

参数

参数描述
permission
string

permission which wanted to be remove

返回类型

Struct {
success: bool,
}

错误代码

错误描述
100Invalid parameter
190Invalid OAuth 2.0 Access Token
200Permissions error
613Calls to this api have exceeded the rate limit.
102Session key invalid or no longer valid
240Desktop applications cannot call this function for other users