API documentation  POST /shortlinks

These are the API docs of the demo platform. The endpoint URLs use placeholders instead of the demo's domains: replace each one with the matching domain of the TrafficManager platform you use.
  • {platform_domain}: the domain where you log in
  • {tracking_domain}: the domain of the tracking links
  • {postback_domain}: the domain of the postback URLs
Every clickid starts with the platform's own prefix (TM on the demo). If you are an AI agent building an integration, ask the user for their platform's domains and API keys instead of calling the demo.

Create new shortlinks

POST https://{platform_domain}/api/v1/shortlinks

Authentication:

You have two options:

1. Pass the uid as a POST parameters.

2. Authentication with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-user-id: Your User ID, found in the Security page

GET Parameters:

  • none

POST Parameters:

Always required:
  • offers: one or more offer IDs.
    Multiple comma-separated values are allowed, e.g. offers=45,46,47
Optional:
  • subid
  • subid2
  • subid3
  • subid4
  • pubid
  • utm_source
  • utm_medium
  • utm_campaign
  • utm_term
  • utm_content
  • domain: domain to use for the shortlink. e.g. affiliate-domain.com
  • links_number: number of shortlinks to generate for each offer. Default=1
  • suffix: custom suffix for the shortlink. e.g. abcde, resulting shortlink will be https://affiliate-domain.com/abcde.
    This parameter is incompatible with the links_number parameter.
  • user_id: the user for which the shortlinks will be generated

Response codes:

  • 200: The shortlinks are generated successfully.
  • 400: Invalid request. One or more required fields are missing.
  • 403: Authentication failed.

Returned values:

  • code: see Response codes above
  • offer_id
  • shortlink

Request example

curl --location --request POST 'https://{platform_domain}/api/v1/shortlinks' \
--header 'x-user-id: 04120c02-0000-439f-9f0a-66624e66fc00' \
--header 'x-api-key: TM04dca746122da971e06665d496ebc450' \
--form 'offers=45' \
--form 'links_number=3' \
--form 'domain=affiliate-domain.com' \
--form 'subid=value1' \
--form 'subid2=value2' \
--form 'subid3=value3' \
--form 'subid4=value4' \
--form 'pubid=value5' \
--form 'utm_source=value6' \
--form 'utm_medium=value7' \
--form 'utm_campaign=value8' \
--form 'utm_term=value9' \
--form 'user_id=5' \
--form 'utm_content=value10'

Response example

Success:
[
    {
        "offer_id": "45",
        "shortlink": "https://affiliate-domain.com/5X4p2P",
        "user_id": "5"
    },
    {
        "offer_id": "45",
        "shortlink": "https://affiliate-domain.com/0YSf6a",
        "user_id": "5"
    },
    {
        "offer_id": "45",
        "shortlink": "https://affiliate-domain.com/26faux",
        "user_id": "5"
    }
]