圖形 API 版本

Has Lead Access

閱讀中

API endpoint used to check that a user and/or app has the permissions needed to download leads. leads_retrieval permission is required to call this API.

圖形 API 測試工具
GET v21.0/{page_id}?fields=has_lead_access.user_id({user_id}) 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}?fields=has_lead_access.user_id({user_id})',
    '{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}?fields=has_lead_access.user_id({user_id})",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "{page_id}?fields=has_lead_access.user_id({user_id})",
    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}?fields=has_lead_access.user_id({user_id})"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Optionally, this endpoint can also be called with app_id.

Graph API Explorer
GET v21.0/{page_id}?fields=has_lead_access.user_id({user_id}).app_id({app_id}) 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}?fields=has_lead_access.user_id({user_id}).app_id({app_id})',
    '{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}?fields=has_lead_access.user_id({user_id}).app_id({app_id})",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "{page_id}?fields=has_lead_access.user_id({user_id}).app_id({app_id})",
    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}?fields=has_lead_access.user_id({user_id}).app_id({app_id})"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果想瞭解如何使用圖形 API,請參閱我們的使用圖形 API 指南

參數

這個端點沒有任何參數。

欄位

欄位說明
app_has_leads_permission
bool

Whether or not the app has lead retrieval permission

can_access_lead
bool

Is lead retrieval possible with the given parameters

enabled_lead_access_manager
bool

Is Lead Access Manager enabled

failure_reason
string

Why lead retrieval is not allowed

failure_resolution
string

How to resolve the lead retrieval failure

is_page_admin
bool

Is the user a page admin

page_id
numeric string

The unique identifier of the page for which the permission/privacy status is being checked

user_has_leads_permission
bool

Whether or not the user has lead permission on the page

user_id
numeric string

The unique identifier of the Facebook user for which the permission/privacy status is being checked

建立中

你無法在此端點執行此操作。

更新中

你無法在此端點執行此操作。

刪除中

你無法在此端點執行此操作。