Skip to main content

Delete Link By Prefix

The Delete Link by Prefix endpoint allows you to delete a specific AppLink using its urlPrefix and shortId. It uses the DELETE method and returns a JSON response with AppLink ID and deleted flag.

Prerequisites

Endpoint​

This is the DELETE URL you’ll use to delete a specific AppLink.

DELETE
https://api.appsonair.link/api/v1/applinks/delete-by-prefix

Request Headers​

See Authorization for the required authentication headers.

Request Payload​

The request payload defines the data required to delete a specific 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 delete 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/delete-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/delete-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: headers,
body: JSON.stringify(body)
})
.then(response => {
if (response.status === 200 || response.status === 204) {
return response.json().catch(() => ({}));
} else {
return response.text().then(text => {
throw new Error(`Error ${response.status}: ${text}`);
});
}
})
.then(data => {
console.log("Success:", data);
})
.catch(error => {
console.error("Error:", error.message);
});

Response​

The API returns either a success response with the ID 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": "XXXXXXXXXX",
"deleted": true
}
FieldTypeDescription
idStringUnique identifier of the AppLink.
deletedBooleanReturns a true or false value.

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.