Graph API Version

App Link Host /app-link-host

An individual app link host object created by an app. An app link host is a wrapper for a group of different app links.

Please see our main App Links documentation to learn more.

Reading

GET /v2.7/{app-link-host-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{app-link-host-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{app-link-host-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{app-link-host-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:@"/{app-link-host-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • Any valid access token is required.

Response

NameDescriptionType

name

A custom name for this app link host.

string

canonical_url

The App Link URL.

string

ios

An array of app links defined for the iOS platform.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to.

string

iphone

An array of app links defined for iPhones.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to.

string

ipad

An array of app links defined for iPads.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to.

string

android

An array of app links defined for the Android platform.

object[]

app_name

The native app's name in the Android store.

string

class

The fully classified class name of the app for intent generation.

string

package

The fully classified package name of the app for intent generation.

string

url

The native Android URL that will be navigated to.

string

windows_phone

An array of app links defined for the Windows Phone platform.

object[]

app_id

The native app's id in the Windows Phone store.

string

app_name

The native app's name in the Windows Phone store.

string

url

The native Windows Phone URL that will be navigated to.

string

web

The web redirect used when the app link URL is loaded in a browser.

object

should_fallback

Determines whether the web link should be used if the native links don't work.

bool

url

The web URL for this app link.

string

Publishing

Apps can create app link hosts using the /app/app_link_hosts edge.

Deleting

Facebook apps can delete app links using this edge:

DELETE /v2.7/{app-link-host-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'DELETE',
  '/{app-link-host-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{app-link-host-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:@"/{app-link-host-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • An app access token is required to delete app link hosts belonging to that app.

Response

Returns true successful, otherwise an error message.

Updating

Facebook apps can update app links using this edge:

/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'POST',
  '/{app-link-host-id}',
  array (
    'name' => 'Updated Name',
    'android' => '[]',
    'web' => '{"should_fallback": true}',
  )
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
POST /v2.7/{app-link-host-id} HTTP/1.1
Host: graph.facebook.com

name=Updated+Name&android=%5B%5D&web=%7B%22should_fallback%22%3A+true%7D
Bundle params = new Bundle();
params.putString("name", "Updated Name");
params.putString("android", "[]");
params.putString("web", "{\"should_fallback\": true}");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{app-link-host-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 = @{
  @"name": @"Updated Name",
  @"android": @"[]",
  @"web": @"{\"should_fallback\": true}",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{app-link-host-id}"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

  • An app access token is required to update app link hosts belonging to that app.

Fields

NameDescriptionType

name

A custom name for this app link host.

string

ios

An array of app links to define for the iOS platform. Any value supplied will overwrite the old list. Removed by passing an empty array.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to. This field is required if using ios.

string

iphone

An array of app links to define for iPhones. Any values supplied will overwrite the old values. Removed by passing an empty array.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to. This field is required if using iphone.

string

ipad

An array of app links to define for iPads. Any value supplied will overwrite the old list. Removed by passing an empty array.

object[]

app_name

The native app's name in the iTunes store.

string

app_store_id

The native app's ID in the iTunes store.

int

url

The native iOS URL that will be navigated to. This field is required if using ipad.

string

android

An array of app links to define for the Android platform. Any value supplied will overwrite the old list. Removed by passing an empty array.

object[]

app_name

The native app's name in the Android store.

string

class

The fully classified class name of the app for intent generation.

string

package

The fully classified package name of the app for intent generation.

string

url

The native Android URL that will be navigated to. This field is required if using android.

string

windows_phone

An array of app links to define for the Windows Phone platform. Any value supplied will overwrite the old list. Removed by passing an empty array.

object[]

app_id

The native app's id in the Windows Phone store.

string

app_name

The native app's name in the Windows Phone store.

string

url

The native Windows Phone URL that will be navigated to. This field is required if using windows_phone.

string

web

The web redirect to use when the app link URL is loaded in a browser.

object

should_fallback

Determines whether the web link should be used if the native links don't work. Default is true if not supplied.

bool

url

The web URL for this app link.

string

Response

Returns true successful, otherwise an error message.