Graph API Version

Page Call To Action

Reading

Returns data on a Call To Action node.

Example

Graph API Explorer
GET /v3.2/{page-call-to-action-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-call-to-action-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-call-to-action-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-call-to-action-id}",
    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-call-to-action-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Requirements

TypeDescription

App Review

Your app must be be approved for the following login permissions and features.

Login permissions

None

Features

Page Public Content Access

Tokens

A User access token for a User who has a role on the Page

Permissions

None

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription
id
numeric string

ID of the call-to-action

android_app

App that stores the destination info on Android

android_deeplink
string

Destination deeplink for the call-to-action on Android

android_destination_type
enum

Destination type for the call-to-action on Android

android_package_name
string

Destination app for the call-to-action on Android

android_url
string

Destination url for the call-to-action on Android

created_time
datetime

Time when the call-to-action was created

email_address
string

Email address that can be contacted by a user

from

Page that owns the call-to-action

intl_number_with_plus
string

International phone number with plus that can be called by a phone

iphone_app

App that stores the destination info on iPhone

iphone_deeplink
string

Destination deeplink for the call-to-action on iPhone

iphone_destination_type
enum

Destination type for the call-to-action on iPhone

iphone_url
string

Destination url for the call-to-action on iPhone

status
enum

Current running status of this action

type
enum

The type of action

updated_time
datetime

Time when the call-to-action was last updated

web_destination_type
enum

Destination type for the call-to-action on desktop

web_url
string

Destination url for the call-to-action on desktop

Creating

You can make a POST request to call_to_actions edge from the following paths:
When posting to this edge, a PageCallToAction will be created.

Creates a new call to action for a Page

Requirements

TypeDescription

App Review

Your app must be be approved for the following login permissions and features.

Login permissions

pages_manage_cta

Features

None

Tokens

A Page access token for an admin of the Page

Permissions

pages_manage_cta

Parameters

ParameterDescription
id
Page ID

ID of the Page

android_app_id
int

ID of the App that stores the destination info on Android

android_deeplink
string

Destination deeplink for the call-to-action on Android

android_destination_type
enum {WEBSITE, APP_DEEPLINK, FACEBOOK_APP, PHONE_CALL, MESSENGER, EMAIL, SHOP_ON_FACEBOOK, NONE}
Default value: NONE

Destination type for the call-to-action on Android

android_package_name
string

Destination app for the call-to-action on Android

android_url
URL

Destination url for the call-to-action on Android

intl_number_with_plus
string

International phone number with plus that can be called through a phone

email_address
string

Email address that can be contacted by a user

iphone_app_id
int

ID fo the App that stores the destination info on iPhone

iphone_deeplink
string

Destination deeplink for the call-to-action on iPhone

iphone_destination_type
enum {WEBSITE, APP_DEEPLINK, FACEBOOK_APP, PHONE_CALL, MESSENGER, EMAIL, SHOP_ON_FACEBOOK, NONE}
Default value: NONE

Destination type for the call-to-action on iPhone

iphone_url
URL

Destination url for the call-to-action on iPhone

type
enum {BOOK_NOW, CALL_NOW, CHARITY_DONATE, CONTACT_US, DONATE_NOW, MESSAGE, OPEN_APP, PLAY_NOW, SHOP_NOW, SIGN_UP, WATCH_NOW, GET_OFFER, GET_OFFER_VIEW, REQUEST_QUOTE, BOOK_APPOINTMENT, LISTEN, EMAIL, LEARN_MORE, REQUEST_APPOINTMENT, GET_DIRECTIONS, BUY_TICKETS, PLAY_MUSIC, VISIT_GROUP, SHOP_ON_FACEBOOK, LOCAL_DEV_PLATFORM, INTERESTED, WOODHENGE_SUPPORT}

The type of action

web_url
URL

Destination url for the call-to-action on desktop

web_destination_type
enum {EMAIL, MESSENGER, NONE, WEBSITE, SHOP_ON_FACEBOOK, BECOME_SUPPORTER}
Default value: NONE

Destination type for the call-to-action on desktop

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Updating

You can update a PageCallToAction by making a POST request to /{page_call_to_action_id}.

Update a Page's Call to Action

Requirements

TypeDescription

App Review

Your app must be be approved for the following login permissions and features.

Login permissions

pages_manage_cta

Features

None

Tokens

A Page access token for an admin of the Page

Permissions

pages_manage_cta

Parameters

ParameterDescription
id
numeric string or integer

ID of the call to action

android_app_id
int

ID of the App that stores the destination info on Android

android_deeplink
string

Destination deeplink for the call-to-action on Android

android_destination_type
enum {WEBSITE, APP_DEEPLINK, FACEBOOK_APP, PHONE_CALL, MESSENGER, EMAIL, SHOP_ON_FACEBOOK, NONE}

Destination type for the call-to-action on Android

android_package_name
string

Destination app for the call-to-action on Android

android_url
URL

Destination url for the call-to-action on Android

intl_number_with_plus
string

International phone number with plus that can be called through a phone

email_address
string

Email address that can be contacted by a user

iphone_app_id
int

ID fo the App that stores the destination info on iPhone

iphone_deeplink
string

Destination deeplink for the call-to-action on iPhone

iphone_destination_type
enum {WEBSITE, APP_DEEPLINK, FACEBOOK_APP, PHONE_CALL, MESSENGER, EMAIL, SHOP_ON_FACEBOOK, NONE}

Destination type for the call-to-action on iPhone

iphone_url
URL

Destination url for the call-to-action on iPhone

type
enum {BOOK_NOW, CALL_NOW, CHARITY_DONATE, CONTACT_US, DONATE_NOW, MESSAGE, OPEN_APP, PLAY_NOW, SHOP_NOW, SIGN_UP, WATCH_NOW, GET_OFFER, GET_OFFER_VIEW, REQUEST_QUOTE, BOOK_APPOINTMENT, LISTEN, EMAIL, LEARN_MORE, REQUEST_APPOINTMENT, GET_DIRECTIONS, BUY_TICKETS, PLAY_MUSIC, VISIT_GROUP, SHOP_ON_FACEBOOK, LOCAL_DEV_PLATFORM, INTERESTED, WOODHENGE_SUPPORT}

The type of action

web_url
URL

Destination url for the call-to-action on desktop

web_destination_type
enum {EMAIL, MESSENGER, NONE, WEBSITE, SHOP_ON_FACEBOOK, BECOME_SUPPORTER}

Destination type for the call-to-action on desktop

Return Type

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

Deleting

You can delete a PageCallToAction by making a DELETE request to /{page_call_to_action_id}.

Delete a Page's Call to Action

Requirements

TypeDescription

App Review

Your app must be be approved for the following login permissions and features.

Login permissions

pages_manage_cta

Features

None

Tokens

A Page access token for an admin of the Page

Permissions

pages_manage_cta

Parameters

ParameterDescription
id
numeric string or integer

ID of the call to action

Return Type

Struct {
success: bool,
}