圖形 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 提出刪除要求,中斷 a Permission 和 a User 的關聯。

參數

參數說明
permission
string

permission which wanted to be remove

傳回類型

Struct {
success: bool,
}

Error Codes

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