Encoding / Decoding

Operations for encoding and decoding numeric values on Everflow

The numeric IDs of certain resources are sometimes encoded on the Everflow platform. For example, when generating a tracking link for offer ID 1 the tracking link will look like so : https://YOUR-TRACKING-DOMAIN.com/28KL6/2CTPL/. In this URL, the 28KL6 portion of the URL identifies the affiliate ID (which is your account’s ID) whereas 2CTPL identifies “offer ID 1”.

It’s normally not necessary to encode / decode the IDs yourself as the values will be encoded automatically when generating tracking links, etc. However, there are certain situations in which it can be useful to access the information.

The following endpoints are made available in case you need to encode or decode the values for different purposes (internal processes that depend on them, etc.).

There are 7 different situations in which numeric IDs are encoded in Everflow :

  • tracking_link_affiliate : the affiliate ID in the context of a tracking link.
  • tracking_link_offer : the offer ID in the context of a tracking link.
  • smart_link_affiliate : the affiliate ID in the context of a smartlink.
  • smart_link_smart_link : the smart link ID in the context of a smartlink tracking link.

Encoding

POST /v1/affiliates/encode

This endpoint allows you to encode numeric IDs for the different situations outlined above.

type string

The situation for which you are encoding the IDs. Values are tracking_link_affiliate, tracking_link_offer, smart_link_affiliate, smart_link_smart_link

ids int array

The IDs you want to encode

{
  "type": "tracking_link_offer",
	"ids": [1, 2, 3]
}

cURL
curl --request POST 'https://api.eflow.team/v1/affiliates/encode' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'
Response
{
  "values": [
    {
      "decoded": 1,
      "encoded": "2CTPL"
    },
    {
      "decoded": 2,
      "encoded": "3QQG7"
    },
    {
      "decoded": 3,
      "encoded": "55M6S"
    }
  ]
}

Decoding

POST /v1/affiliates/decode

This endpoint allows you to decode numeric IDs that have been encoded in the Everflow platform.

Values that cannot be decoded will return 0.

type string

The situation in which the IDs were encoded. Values are tracking_link_affiliate, tracking_link_offer, smart_link_affiliate, smart_link_smart_link

ids string array

The encoded IDs you want to decode

{
  "type": "tracking_link_offer",
	"ids": ["2CTPL", "3QQG7", "55M6S"]
}

cURL
curl --request POST 'https://api.eflow.team/v1/affiliates/decode' \
--header 'X-Eflow-API-Key: <INSERT API KEY>' \
--header 'Content-Type: application/json' \
--data '<INSERT PAYLOAD>'
Response
{
  "values": [
    {
      "decoded": 1,
      "encoded": "2CTPL"
    },
    {
      "decoded": 2,
      "encoded": "3QQG7"
    },
    {
      "decoded": 3,
      "encoded": "55M6S"
    }
  ]
}