This document refers to a feature that was removed after Graph API v2.2.
Graph API Version

Graph API Reference /{page-id}/tabs

The apps that this Page has added as tabs.

Related Guides

Reading

Graph API Explorer
GET /v3.3/{page-id}/tabs 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}/tabs',
    '{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}/tabs",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/tabs",
    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}/tabs"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • A page access token is required to retrieve tabs for a page.

Fields

NameDescriptionType

id

A concatenation of the Page ID, /tabs/ and the tab app ID prefixed with app_:
{page-id}/tabs/app_{app-id}

string

image_url

The location of the tab's thumbnail image.

string

name

The tab name, which can be different from the name of the app it links to.

string

link

A link directly to this Page tab.

string

application

The app that's in the tab.

App

is_permanent

A flag to identify whether the tab can be removed from the Page (core tabs such as 'Likes' cannot be removed).

bool

position

Where this tab is located in the list of tabs.

int

is_non_connection_landing_tab

A flag to identify whether the tab is a custom landing tab for viewers who are not already connected to this Page.

bool

Publishing

You can add apps as a tab, or install them for a Page using this edge:

POST /v3.3/{page-id}/tabs HTTP/1.1
Host: graph.facebook.com

app_id=%7Bapp-id%7D
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{page-id}/tabs',
    array (
      '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}/tabs",
    "POST",
    {
        "app_id": "{app-id}"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("app_id", "{app-id}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/tabs",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"app_id": @"{app-id}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/tabs"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • A page access token is required to add tabs to a Page.

Fields

NameDescriptionType

app_id

ID of the app that you want to add as a tab.

string

Response

If successful:

{
  "success": true
}

Otherwise a relevant error message will be returned.

Deleting

You can remove tabs using this edge:

DELETE /v3.3/{page-id}/tabs/app_{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->delete(
    '/{page-id}/tabs/app_{app-id}',
    array (),
    '{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}/tabs/app_{app-id}",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/tabs/app_{app-id}",
    null,
    HttpMethod.DELETE,
    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}/tabs/app_{app-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • A page access token is required to remove tabs from a Page.

Fields

NameDescriptionType

app-id

ID of the tab app that you want to remove. The app ID is prefixed with app_.

string

Response

If successful:

{
  "success": true
}

Otherwise a relevant error message will be returned.

Updating

You can update tabs by using this edge ({app-id} is the ID of the app in the tab that you want to update):

POST /v3.3/{page-id}/tabs/app_{app-id} HTTP/1.1
Host: graph.facebook.com

position=3&custom_name=Newtabname
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{page-id}/tabs/app_{app-id}',
    array (
      'position' => 3,
      'custom_name' => 'Newtabname',
    ),
    '{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}/tabs/app_{app-id}",
    "POST",
    {
        "position": 3,
        "custom_name": "Newtabname"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putInt("position", 3);
params.putString("custom_name", "Newtabname");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/tabs/app_{app-id}",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"position": @3,
  @"custom_name": @"Newtabname",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/tabs/app_{app-id}"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • A page access token is required to update tabs on a Page.

Fields

NameDescriptionType

position

Order in which the tab will appear on the profile. Must be after permanent tabs and less than the number of installed tabs. Index starts at 0

int

custom_name

Name to be used for the tab. If this is set to an empty string, the tab will use the application’s default tab name.

string

is_non_connection_landing_tab

Set this tab as the default landing tab for users who have not liked and are not admins of the Page. If provided, value must be true.

bool

custom_image_url

URL for an image to be used as a custom icon for this Page app. Note that either custom_image_url or custom_image can be set, but not both.

string

custom_image

The name of an image file to be used as a custom icon for this Page app. Note that either custom_image_url or custom_image can be set, but not both.

multipart/form-data

Response

If successful:

{
  "success": true
}

Otherwise a relevant error message will be returned.