Graph API Version

Page Leadgen Whitelisted Users

Reading

List of all whitelisted users of a page.

Graph API Explorer
GET /v2.10/{page-id}/leadgen_whitelisted_users HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{page-id}/leadgen_whitelisted_users'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/leadgen_whitelisted_users",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/leadgen_whitelisted_users",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/leadgen_whitelisted_users"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

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

data

A list of User nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
200Permissions error

Creating

You can't perform this operation on this endpoint.

Updating

You can update a User by making a POST request to /{page_id}/leadgen_whitelisted_users.

Parameters

NameDescription
user_id
int

ID of the user to be whitelisted for the page.

Required

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
200Permissions error
100Invalid parameter
210User not visible

Deleting

You can dissociate a User from a Page by making a DELETE request to /{page_id}/leadgen_whitelisted_users.

Parameters

NameDescription
user_id
numeric string

ID of the user to be removed from whitelist for the page.

Required

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
210User not visible