Graph API Version

/{user-id}/ids_for_business

If you're a business that has more than one app and you want to do cross-app promotions, you can use this endpoint to map user IDs from one app to another. This edge returns the list of IDs that this user has in any of those other apps.

This edge only works for companies that have set up Facebook for Business and added their apps to the Business Manager. Learn more about apps and Facebook for Business in our documentation.

Reading

Graph API Explorer
GET /v12.0/me/ids_for_business 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(
    '/me/ids_for_business',
    '{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(
    "/me/ids_for_business",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/me/ids_for_business",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/me/ids_for_business"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • A user access token is required to view that user's IDs in other apps owned by the same business entity as the session app.
  • An app access token can also be used to view a user's IDs in other apps owned by the same business entity as that app.

Fields

Reading this endpoint returns a list of IDs from different business-owner apps:

Name Description Type

id

The ID that identifies the request user in this particular app.

string

app

The app to which the ID is scoped.

App

Publishing, Updating and Deletion

You can't perform these operations on this edge.