Sub-id management

1. Description

These Sub-id management methods provide an API frontend that enables the management of your sub-ids.

The number of sub-id you can use at a given point is limited +to 100 per geozone+ and should be declared before use.

A subid is an unique identification tag.

It enables you to track your traffic depending on your segmentation (your different website pages or your different domains, etc).

You will be able to consult your report (clicks & revenues) by subid and identify the most efficient segments. You have to tag your URL with it.
Example: http://api.wtpn.twenga.fr/v2.1/search/offer?[...]&subid=homepage

Subid can contain letters, numbers, special characters “-._” and spaces (no double spaces allowed). Subid must contain at most 32 characters.

You can use Sub-id management to manage your list, several calls are available to consult, declare or delete sub-id(s).

Note: Subid can also be declared at click level. In this case, the subid declared at click level overloads the value declared at display level. The parameter to use in this case is "csubid".

2. API calls:

Before using this call, you must authenticate to get your token.

The following calls use the same url https://api.affinitad.com/subid/ and the action to perform is defined by the type of the method (GET/POST/DELETE).

2.1 Consult sub-ids (GET)

To consult your sub-id(s) you have to call https://api.affinitad.com/subid/ using the method GET.

The following parameters are available to specify the details of your call:

URL Parameter Mandatory Description
token Yes reporting request start date, date format should be as follows YYYY-MM-DD. Unique identification key. To get a token, use authenticate call: https://api.affinitad.com/authenticate.
You can then use this token during 30 min for your API calls.
geozone[] No The geozone for wich you want to declare your sub-id(s). Expected values are the 2-letter ISO 3166-1 Country Codes. Currently allowed values are :
  • FR for France
  • US for United States
  • GB for United Kingdom
  • DE for Germany
  • ES for Spain
  • IT for Italy
  • PL for Poland
  • NL for the Netherlands
  • BR for Brazil
  • SE for Sweden

API Call samples

https://api.affinitad.com/subid?token=[...]&subid[]=123&sub_id=456&geozone[]=FR&geozone[]=GB

Error codes

  • 400 ⇒ Bad Request: one of the fields contains wrong data. Error details in the answer
  • 200 ⇒ OK:
  • 204 ⇒ No content. The request has been done but there is no sub-id declared

JSON XML

{
    "result": {
        "FR": [
            "1",
            "beabase",
            "code-promotionnel.com",
            "Maboutique.com",
            "p1_s10_so1",
            "p1_s10_so2"    
        ],

        "NL": [
            "lemonde"
        ]
    },
    "code": 200
}

<?xml version="1.0" encoding="utf-8"?>
<xml>
    <result>
        <FR>
            <item>1</item>
            <item>beabase</item>
            <item>code-promotionnel.com</item>
            <item>Maboutique.com</item>
            <item>p1_s10_so1</item>
            <item>p1_s10_so2</item>
        </FR>
        <NL>
            <item>lemonde</item>
        </NL>
    </result>
    <code>200< /code>
</xml>

2.2 Declare sub-ids (POST)

To declare new sub-id(s) you have to call https://api.affinitad.com/subid/ using the method POST.

Note: The declaration is effective at the latest after 1 hour and 15 minutes.

The following parameters are available to specify the details of your call:

URL Parameter Mandatory Description
token Yes reporting request start date, date format should be as follows YYYY-MM-DD. Unique identification key. To get a token, use authenticate call: https://api.affinitad.com/authenticate.
You can then use this token during 30 min for your API calls.
geozone[] No The geozone for wich you want to declare your sub-id(s). Expected values are the 2-letter ISO 3166-1 Country Codes. Currently allowed values are :
  • FR for France
  • US for United States
  • GB for United Kingdom
  • DE for Germany
  • ES for Spain
  • IT for Italy
  • PL for Poland
  • NL for the Netherlands
  • BR for Brazil
  • SE for Sweden
Form data Mandatory Description
subid[] Yes List of sub-ids to declare.
Format: ...subid[]=123&subid[]=124...
geozone[] Yes The geozone for wich you want to declare your sub-id(s). Expected values are the 2-letter ISO 3166-1 Country Codes. Currently allowed values are :
  • FR for France
  • US for United States
  • GB for United Kingdom
  • DE for Germany
  • ES for Spain
  • IT for Italy
  • PL for Poland
  • NL for the Netherlands
  • BR for Brazil
  • SE for Sweden

2.3 Delete sub-ids (DELETE)

To delete sub-id you have to call https://api.affinitad.com/subid/ using the method DELETE.

The following parameters are available to specify the details of your call:

URL Parameter Mandatory Description
token Yes reporting request start date, date format should be as follows YYYY-MM-DD. Unique identification key. To get a token, use authenticate call: https://api.affinitad.com/authenticate.
You can then use this token during 30 min for your API calls.
subid[] Yes
geozone[] Yes The geozone for wich you want to declare your sub-id(s). Expected values are the 2-letter ISO 3166-1 Country Codes. Currently allowed values are :
  • FR for France
  • US for United States
  • GB for United Kingdom
  • DE for Germany
  • ES for Spain
  • IT for Italy
  • PL for Poland
  • NL for the Netherlands
  • BR for Brazil
  • SE for Sweden

Error codes

  • 400 ⇒ Bad Request: one of the fields contains wrong data. Error details in the answer
  • 204 ⇒ OK: