Adtraction API v3
This is the full documentation for the Adtraction API, version 3.
In order to access the API, you need an account with Adtraction. You can pick up your unique API token by logging in to your Adtraction account and navigating to Account > Settings.
The documentation is interactive; calls can be made to all documented endpoints within the browser without the need to write any code.
If you have any questions regarding the API, feel free to contact support@adtraction.com.
API url
The base url for all API version 3 endpoints is https://api.adtraction.net/v3/
Useful links
General notes
| Encoding | Every string passed to and from the Adtraction API needs to be UTF-8 encoded. |
| SSL | We require that all requests are done over SSL. |
| Date format | The Adtraction tracking server is running on Stockholm time. All dates are in ISO 8601 format expressed as UTC (Coordinated Universal Time). Time zones are represented as an offset from UTC. Example: 2019-07-16T14:45:15+0200 |
Header parameters
| X-Token | Defines the request API token. This will be used to determine privileges and visibility for the request. |
| content-type | Defines the format of data sent to Adtraction. Adtraction accepts JSON. Example: content-type: application/json |
| accept | Defines the format of data received from Adtraction. Adtraction supports JSON. Example: accept: application/json |
Pagination
Certain endpoints will generate large result sets. To save bandwidth and long processing times, these endpoints will paginate the results to reduce the strain on both client and server.
Any endpoint that supports pagination will return 3 attributes to support this:
-
count- the total number of results available -
pageSize- the number of results per page to return -
page- the number of the page to return. The first page in the response is number 0.
Rate limiting
The API endpoints are rate limited by a quota per minute.
On each request the remaining quota is decreased. If the remaining quota is less than zero, the status code 429 will be returned with a message containing the time remaining until reset.
Each endpoint response includes header parameters with information about its limit, remaining requests and reset time. Example:
Status: 200 OK
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1561967218095
| Header name | Description |
|---|---|
| X-RateLimit-Limit | The maximum number of requests you’re permitted to make per hour. |
| X-RateLimit-Remaining | The number of requests remaining in the current rate limit window. |
| X-RateLimit-Reset | The time at which the current rate limit window resets in UTC epoch seconds. |
Response codes and statuses
| Code | Status | Description |
|---|---|---|
| 200 | OK | The request has succeeded. |
| 201 | Created | The request has been fulfilled and resulted in a new resource being created. |
| 204 | No content | The server successfully processed the request, but is not returning any content. |
| 400 | Bad request | The request could not be understood by the server due to malformed syntax. |
| 401 | Unauthorized | The request requires user authentication. |
| 403 | Forbidden | The server understood the request, but user is not authorized to perform the operation. |
| 404 | Not found | The server has not found anything matching the Request-URI. |
| 409 | Conflict | The request could not be completed due to a conflict with the current state of the resource. |
| 415 | Unsupported media type | The request entity has a media type which the server or resource does not support. |
| 429 | Too many requests | Your are making too many requests and are being rate limited. |
| 500 | Internal server error | The server encountered an unexpected condition which prevented it from fulfilling the request. |
Partner ¶
Commission types ¶
Each partner program on the Adtraction platform offers one or several types of commissions, such as commission for a confirmed purchase or a newsletter signup.
List commission typesGET/partner/programs/commissions/{programId}/{channelId}/{?token}
List all the commission types available for a partner program.
Using channelId as input will return the commissions of the segment that the channel currently belongs to. If channelId is not provided, the commissions in the standard segment will be returned.
Example URI
- programId
number(required) Example: 23959067Numerical ID of the partner program
- channelId
number(optional) Example: 101496920Numerical ID of a channel
- token
string(required) Example: E0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8200Headers
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1565602012124
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: closeBody
[
{
"id": "1066446216",
"type": "SEK",
"name": "Sale new customer",
"value": 100,
"transactionType": 3,
"categories": [
{
"category": "Books",
"type": "%",
"value": 4.5
}
],
"thresholds": [
{
"orderValue": 1500,
"type": "SEK",
"value": 7.5
}
]
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Product feed ¶
Retrieve product feedPOST/partner/products/feed/{?token}
Retrieves data for all available products for a specified advertiser. Meta data is available in the response header, where count is the number of products available, and feed_lastupdated is the time the advertiser last updated their product feed.
Example URI
- token
string(required) Example: E0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8- programId
number(required)Numerical ID of a partner program
- channelId
number(required)Numerical ID of a channel
- feedId
number(optional)Numerical ID of a product feed
- setEpi
boolean(optional)If set to true, the epi will be set to the product name in tracking urls
- gt
boolean(optional)Should be set to true if tracking links included in the product feed should comply with with the Transparent Click Tracker requirements in Google Ads.
Body
{
"programId": 23959067,
"channelId": 101496920,
"feedId": 749,
"setEpi": true,
"gt": false
}Schema
{
"type": "object",
"properties": {
"programId": {
"type": "number",
"description": "Numerical ID of a partner program"
},
"channelId": {
"type": "number",
"description": "Numerical ID of a channel"
},
"feedId": {
"type": "number",
"description": "Numerical ID of a product feed"
},
"setEpi": {
"type": "boolean",
"description": "If set to true, the epi will be set to the product name in tracking urls"
},
"gt": {
"type": "boolean",
"description": "Should be set to true if tracking links included in the product feed should comply with with the Transparent Click Tracker requirements in Google Ads."
}
},
"required": [
"programId",
"channelId"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}200Headers
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1565602012124
count: 4547
feed_lastupdated: Tue Aug 27 14:56:30 CEST 2019
Content-Type: application/json;charset=UTF-8
Content-Length: 17959940
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: closeBody
[
{
"productName": "PlayStation 5",
"productPrice": "129.5",
"productUrl": "https://www.site.com/store/product_acb",
"trackingUrl": "https://track.adtraction.com/t/t?a=24209996&as=24577691&t=2&tk=1",
"currency": "EUR",
"programId": 1062755777,
"approvalStatus": 1,
"ean": "0711719437215",
"sku": "abc123",
"extraInfo": [
{
"key": "color",
"value": "red"
}
],
"imageUrl": "http://www.site.com/store/product_acb.png",
"inStock": true,
"manufacturer": "Sony",
"manufacturerArticleNumber": "12345678",
"market": "SE",
"oldPrice": 45,
"productCategory": "Consoles",
"productDescription": "PlayStation 4 redefines rich and immersive gameplay with powerful graphics and speed.",
"shipping": 9
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Product feed info ¶
Retrieve product feed informationGET/partner/products/feedinfo/{programId}/{channelId}/{?token}
Retrieves information about the products feeds available for a specific advertiser, including number of available products, last updated status and link to download the data file.
Example URI
- programId
number(required) Example: 23959067Numerical ID of an partner program
- channelId
number(required) Example: 101496920Numerical ID of a channel
- token
string(required) Example: E0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8200Headers
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1565602012124
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: closeBody
[
{
"feedId": 321,
"name": "Electronics",
"approvalStatus": 1,
"feedUrl": "https://adtraction.com/productfeed.htm?type=feed&format=XML&encoding=UTF8&epi=0&zip=0&cdelim=tab&tdelim=singlequote&sd=0&flat=0&apid=23959067&asid=101496920",
"lastUpdated": "2018-01-01T10:15:12+0100",
"numberOfProducts": 12055
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Programs ¶
Each advertiser on the Adtraction platform has their own partner program, which is a partnership where partners send visitors to the advertiser in exchange for commission. Each partner program has rules about what kind of advertising is permitted and what commission is offered.
Retreive program informationPOST/partner/programs/{?token}
Retreives information about partners programs available in on the Adtraction platform.
Example URI
- token
string(required) Example: E0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8- market
string(required)Geographical market on which a partner program is available, defined by an ISO 3166-1 Alpha-2 country code
- programId
number(optional)Numerical ID of an partner program
- channelId
number(optional)Numerical ID of a channel
- approvalStatus
number(optional)Approval status for a partner program: 0 = rejected, 1 = approved, 2 = pending review
- status
number(optional)The status of the partner program on the Adtraction platform, where Live = 0 and Closing = 3
Body
{
"market": "SE",
"programId": 629059552,
"channelId": 1175982945,
"approvalStatus": 1,
"status": 0
}Schema
{
"type": "object",
"properties": {
"market": {
"type": "string",
"description": "Geographical market on which a partner program is available, defined by an ISO 3166-1 Alpha-2 country code"
},
"programId": {
"type": "number",
"description": "Numerical ID of an partner program"
},
"channelId": {
"type": "number",
"description": "Numerical ID of a channel"
},
"approvalStatus": {
"type": "number",
"description": "Approval status for a partner program: 0 = rejected, 1 = approved, 2 = pending review"
},
"status": {
"type": "number",
"description": "The status of the partner program on the Adtraction platform, where Live = 0 and Closing = 3"
}
},
"required": [
"market"
],
"$schema": "http://json-schema.org/draft-04/schema#"
}200Headers
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1565602012124
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: closeBody
[
{
"programId": 629059552,
"market": "SE",
"currency": "SEK",
"approvalStatus": 1,
"ppcMarketing": 1,
"socialMarketing": 1,
"emailMarketing": 1,
"cashbackMarketing": 1,
"couponMarketing": 1,
"programName": "Kitchentime SE",
"programURL": "https://www.kitchentime.se",
"currentSegment": "Gold",
"pendingActive": false,
"cookieDuration": 45,
"adId": 1062755777,
"commissions": [
{
"id": "1066446216",
"type": "SEK",
"name": "Sale new customer",
"value": 100,
"transactionType": 3,
"categories": [
{
"category": "Books",
"type": "%",
"value": 4.5
}
],
"thresholds": [
{
"orderValue": 1500,
"type": "SEK",
"value": 7.5
}
]
}
],
"feeds": [
{
"feedUrl": "https://adtraction.com/productfeed.htm?type=feed&format=XML&encoding=UTF8&epi=0&zip=0&cdelim=tab&tdelim=singlequote&sd=0&flat=0&apid=1035156879&asid=141&pfid=506",
"lastUpdated": "2022-02-03T02:05:06+0100",
"numberOfProducts": 4564,
"feedId": 759,
"name": "Standard"
}
],
"logoURL": "https://secure.adtraction.com/image.htm?imgId=56807831",
"trackingURL": "https://track.adtraction.com/t/t?a=24209996&as=24577691&t=2&tk=1",
"categoryName": "Fashion & accessories",
"categoryId": 1,
"trackingType": 2,
"status": 0,
"epc": 1.94
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Client ¶
Channels ¶
A channel is where a partner places banners or links to promote your partner program. It can be, for example, a website, a blog or a newsletter. It may also be paid advertising on, for example, Adwords or Facebook.
List channelsPOST/client/channels/{?token}
Lists all channels that have applied to your program.
Example URI
- token
string(required) Example: D0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8- channelId
number(optional)Numerical ID of a channel.
- affiliateId
number(optional)Numerical ID of a partner account.
- approvalStatus
number(optional)Approval status of a channel for a partner program: 0 = rejected, 1 = approved, 2 = pending review
Body
{
"channelId": 26148592,
"affiliateId": 26148590,
"approvalStatus": 0
}Schema
{
"type": "object",
"properties": {
"channelId": {
"type": "number",
"description": "Numerical ID of a channel."
},
"affiliateId": {
"type": "number",
"description": "Numerical ID of a partner account."
},
"approvalStatus": {
"type": "number",
"description": "Approval status of a channel for a partner program: 0 = rejected, 1 = approved, 2 = pending review"
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}200Headers
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1565602012124
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: closeBody
[
{
"affiliateId": 906248154,
"affiliateName": "John Doe",
"channelId": 1062755777,
"channelName": "John's business blog",
"channelDescription": "A blog about business.",
"channelUrl": "https://www.johnsblog.com",
"channelType": "Blog",
"approvalStatus": 0,
"applicationDate": "2021-11-31",
"rejectReason": 3,
"reasonText": "404 on site"
}
]Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}Update channel statusPUT/client/channels/{?token}
Update the approval status for a channel in your program. Status can be updated to rejected (0) or approved (1).
Example URI
- token
string(required) Example: D0E6BF3556DB0D83C8B401EBACBD6F1B0670633EYour Adtraction API token
Headers
Content-Type: application/json;charset=UTF-8- channelId
number(optional)Numerical ID of a channel.
- approvalStatus
number(optional)Approval status of a channel for a partner program: 0 = rejected, 1 = approved
- rejectReason
number(optional)Required when approvalStatus is changed to: 0. The reason for rejecting the program application, where: 0 = Not enough content/posts, 1 = Not relevant content, 2 = A closed site/group/account, 3 = 404 on site, 4 = Site does not exist, 5 = Wrong contact details / shady details, 6 = Unethical content, 7 = Incorrect site owner, 8 = Missing info about the channel. No URL/link, 9 = To few followers/visitors, 10 = Poor design, 11 = Traffic is not relevant. 12 = Outdated content
Body
{
"channelId": 26148592,
"approvalStatus": 0,
"rejectReason": 3
}Schema
{
"type": "object",
"properties": {
"channelId": {
"type": "number",
"description": "Numerical ID of a channel."
},
"approvalStatus": {
"type": "number",
"description": "Approval status of a channel for a partner program: 0 = rejected, 1 = approved"
},
"rejectReason": {
"type": "number",
"description": "Required when approvalStatus is changed to: 0. The reason for rejecting the program application, where: 0 = Not enough content/posts, 1 = Not relevant content, 2 = A closed site/group/account, 3 = 404 on site, 4 = Site does not exist, 5 = Wrong contact details / shady details, 6 = Unethical content, 7 = Incorrect site owner, 8 = Missing info about the channel. No URL/link, 9 = To few followers/visitors, 10 = Poor design, 11 = Traffic is not relevant. 12 = Outdated content"
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}200Headers
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 12 Aug 2019 09:25:52 GMT
Connection: close- success
boolean(optional)True or false
Body
{
"success": true
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"success": {
"type": "boolean",
"description": "True or false"
}
}
}