Skip to main content

Get Link By Prefix

The Get Link by Prefix endpoint allows you to retrieve the details of a specific AppLink using its urlPrefix and shortId. It uses the POST method and returns a JSON response containing all the information associated with the requested link.

Prerequisites

Endpoint​

This is the POST URL you’ll use to get the AppLink.

POST
https://api.appsonair.link/api/v1/applinks/get-by-prefix

Request Headers​

See Authorization for the required authentication headers.

Request Payload​

The request payload defines the data required to get the AppLink. The payload must be sent in JSON format within the body of the request.

Body
{
"data": {
"urlPrefix": "example.appsonair.link", // Shouldn't contain http or https
"shortId": "XXXXX"
}
}

AppLinkParams Properties​

Defines all parameters used to get an AppLink.

KeyTypeDescription
urlPrefixStringThe domain prefix of the AppLink Example: app.domain.com.
shortIdStringThe unique identifier (Short ID) for the AppLink.

Usage​

Example Request​

cURL
curl --location 'https://api.appsonair.link/api/v1/applinks/get-by-prefix' \
--header 'x-api-key: XXXXXXXXXXXXXXXXXXXX' \
--header 'x-app-key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"urlPrefix": "example.appsonair.link",
"shortId": "XXXXX"
}
}'

Code Snippets​

index.js
const fetch = require("node-fetch");

const url = "https://api.appsonair.link/api/v1/applinks/get-by-prefix";

const headers = {
"x-api-key": "XXXXXXXXXXXXXXXXXXXX",
"x-app-key": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"Content-Type": "application/json"
};

const body = {
data: {
urlPrefix: "example.appsonair.link", // Shouldn't contain http or https
shortId: "XXXXX"
}
};

fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body)
})
.then(response => response.json())
.then(data => {
console.log("Success:", data);
})
.catch(error => {
console.error("Error:", error);
});

Response​

The API returns either a success response with the details of the AppLink or an error response if the request is invalid. The examples below illustrate both scenarios.

Success Response​

If the request is successful, the API returns a 200 status code along with details of the AppLink.

Status: 200
{
"id": "XXXXXXXXXXXXXXXXXXXXXX",
"link": "https://custom-domain.com/XXXXX",
"brandedLink": "https://example.appsonair.link/XXXXX",
"data": {
"name": "AppsOnAir",
"url": "https://appsonair.com",
"shortId": "XXXXX",
"socialMeta": {
"title": "Link title",
"description": "Link description",
"imageUrl": "https://image.png"
},
"appsFlyer": {
"channel": "appsonair",
"campaignId": "01",
"campaign": "test",
"subs": ["sub1", "sub2", "sub3", "sub4", "sub5"],
"metaTitle": "metaTitle",
"metaDescription": "metaDescription"
},
"attributionTtl": 3600
}
}
Note:

The link field is returned only if a custom domain is configured.

appsFlyer and attributionTtl are returned only for links that were created with them.

FieldTypeDescription
idStringUnique identifier of the AppLink.
linkStringURL generated by AppLink. This field is returned only if a custom domain is configured.
brandedLinkStringBranded URL generated using your configured domain. Always returned.
data.nameStringName given to the AppLink.
data.urlStringOriginal URL that the AppLink redirects to.
data.shortIdStringShort identifier for the link, automatically generated if not provided.
data.socialMeta.titleStringTitle of the link used in social media previews.
data.socialMeta.descriptionStringDescription of the link used in social media previews.
data.socialMeta.imageUrlStringImage URL displayed when the link is shared on social platforms.
data.appsFlyerObjectAppsFlyer attribution parameters attached to the link. Refer to AppsFlyer Fields.
data.attributionTtlNumberAttribution window configured for the link, in seconds.

AppsFlyer Fields​

FieldTypeDescription
channelStringThe media source or channel driving traffic to this link.
campaignIdStringUnique identifier for the marketing campaign.
campaignStringHuman-readable name of the marketing campaign.
subsString[]Sub-parameters used for granular tracking. Defaults to the link's shortId as sub1.
metaTitleStringTitle shown on the Android redirection page.
metaDescriptionStringDescription shown on the Android redirection page.

Error Response​

If the request is invalid, unauthorized, or required parameters are missing, the API returns an error status code (such as 400, 401, or 404) along with a message describing the issue.

Status: 400
{
"statusCode": 400,
"message": "Application id is required!"
}
FieldTypeDescription
statusCodeNumberHTTP status code representing the error (e.g., 400 for a bad request).
messageStringA human-readable message explaining the reason for the error.

Rate Limits​

This API is rate-limited. For more details, visit the Rate Limits & Error Handling section.