API Authentication
All requests to the Apliko Link backend API must be authenticated using an API key. Unauthenticated requests will fail with a 401 Unauthorized
status code.
Need an API Key?
To get started, you'll need an API key. Contact us to get onboarded and receive your key.
Contact Us to Get Your Key →Using the API Key
To authenticate your requests, you must include your API key in the X-API-KEY
header of every request.
bash
X-API-KEY: YOUR_API_KEY
Example Request
Here is an example of how to make an authenticated request using curl
to the endpoint for creating a new link.
bash
curl -X POST "https://api.apliko.link/v1/links/" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "DEEPLINK",
"redirectUrl": "myapp://product/123",
"domainUriPrefix": "https://example.nvgt.link",
"shortCode": "promo2025",
"metadata": {
"campaign": "summer_sale"
}
}'
Example with JavaScript (fetch)
This example shows how to make the same request using the native fetch
API in a JavaScript environment.
javascript
const apiKey = 'YOUR_API_KEY';
const apiUrl = 'https://api.apliko.link/v1/links/';
const linkData = {
type: "DEEPLINK",
redirectUrl: "myapp://product/123",
domainUriPrefix: "https://example.nvgt.link",
shortCode: "promo2025",
socialTitle: "Special Product Offer",
socialDescription: "Check out this amazing product and get 20% off!",
socialImageLink: "https://images.example.com/product-123.png",
metadata: {
campaign: "summer_sale",
source: "email_blast"
}
};
fetch(apiUrl, {
method: 'POST',
headers: {
'X-API-KEY': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify(linkData)
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('Link created successfully:', data);
})
.catch(error => {
console.error('Error creating link:', error);
});