Overview

Link API

What is this API for?

Link API is an endpoint that generates an Aklamio referral short link for your user to share with their follower - your call can be in client to server mode or server to server mode. Primary information such as your user's - the recommender - email address and your Promotion ID are required in your API call in order get a referral link generated.

API Details

Endpoint URL: https://api.aklamio.com/api/v1/link
Method: POST
Header: Api-Secret

Authentication

This endpoint needs an additional header with the request: Api-Secret. This header key is used to validate the brand and promotion used in payload. Ask your Aklmaio Customer Success Manager or Integration Manager for your brand's API Secret Key.

Request Parameters

Field name
Description
Type
Mode
uid
Promotion UID: Identifies your program within Aklamio. If you have several programs (e.g. countries), a distinction is made via this parameter.
string
required provided by Aklamio
email
Recommender's email address.
string
required
rr
This field determines the reward splitting options between the recommender and the follower (NB! mittlr indicates the recommender keeping the reward): :mittlr, :shared, :follower
string
optional
product_id
Optional product ID (when creating a product referral link).
string
optional
title
Optional title (when creating a product referral link).
string
optional
target_url
Optional target page URL (when creating a product referral link).
string
optional
event_source
You have the option to specify an event source to indicate the origin of the link generation API usage. If this parameter is omitted, the default value will be 'APP'. It's important to note that the reserved value 'portal' should not be used. developers are advised that if they choose to utilize this parameter for transmitting a custom value, it's crucial to coordinate their input with their designated Aklamio Integrations contact person.
string
optional

Sample Responses

Response sample: Success (default)

            {
  "short_link": "http://aklam.io/bVGvXp",
  "channels": {
    "email": "http://aklam.io/d3OJet",
    "facebook": "http://shortener.aklamio.com/tOcsFY",
    "whatsapp": "http://aklam.io/ceQ8Go",
    "link": "http://aklam.io/uiCzAU"
  },
  "coupon": null,
}
          

Response sample: Success (Reward Codes use case)

            {
  "short_link": "http://aklam.io/bVGvXp",
  "channels": {
    "email": "http://aklam.io/d3OJet",
    "facebook": "http://shortener.aklamio.com/tOcsFY",
    "whatsapp": "http://aklam.io/ceQ8Go",
    "link": "http://aklam.io/uiCzAU"
  },
  "coupon": "OZEPPVSJ",
}
          

Response sample: Error

            Status Code: 401
{
  "error": "unauthorized"
}
          
            Status Code: 404
{
  "error": "unknown"
}
          

Code examples

Code examples

Code copied!

            curl --location --request POST 'https://api.aklamio.com/api/v1/link' \
--header 'Api-Secret: ecaf9019ab9cc298310d218760b1587f' \
--header 'Content-Type: application/json' \
--data-raw '{
  "email": "sample@email.com",
  "uid": "df96dc88b09a66177284bjhcb5d21422"
}'