2API Version 2 - Release Date: March 01, 2022
Authentication
To get started, please obtain your unique API key by logging into your account and navigating to the Account Details page > API key section. This page allows you to also refresh/revoke the generated keys to maintain the high level of security for your applications.
...
Affiliates can access: https://api.sourceknowledge.com/doc/affiliate to view an interactive documentation, which shows and describes all our available endpoints and parameters, and gives Affiliates the ability to test the endpoints directly on the page. Be aware that when interacting with create/edit API as it could update your campaign settings.
API version 2
Why should we use version 2?
Version 2 includes:
Improvements in the consistency of the results.
Performance improvements on endpoints.
New features that allow writing operations and provide automated and remote campaign control.
Advertisers
Expand |
---|
|
Returns advertiser categories. If you do not have access to this end point, please contact your account manager. Endpoint/affiliate/v2/categoriese.g. /affiliate/v2/categories Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| [
{
"id": 0,
"name": "string"
}
] |
|
Expand |
---|
|
Returns Advertisers Endpoint/affiliate/v2/advertiserse.g. /affiliate/v2/advertisers FiltersName | Description |
---|
page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
|
Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"id": 0,
"name": "string",
"businessUrl": "string",
"categoryId": 0,
"categoryName": "string"
}
],
"hasMore": true,
"page": 0
} |
|
Expand |
---|
title | Create advertiser [POST Advertisers] |
---|
|
Endpoint Tip |
---|
/affiliate/v2/advertiserse.g. /affiliate/v2/advertisers |
FiltersName | Description |
---|
body | Required Advertiser settings Example: Code Block |
---|
| {
"name": "string",
"businessUrl": "string",
"categoryId": 0
} |
| | To get list categories with ids see /affiliate/v2/categories |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"businessUrl": "string",
"categoryId": 0,
"categoryName": "string"
} |
|
Expand |
---|
|
Returns detailed information about the advertiser Endpoint/affiliate/v2/advertisers/{id}e.g. /affiliate/v2/advertisers/10 FiltersName | Description |
---|
id | Required Advertiser Id Example: id=10 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"businessUrl": "string",
"categoryId": 0,
"categoryName": "string"
} |
|
Expand |
---|
title | Edit advertiser [PUT Advertisers id] |
---|
|
Endpoint Tip |
---|
/affiliate/v2/advertisers/{id}e.g. /affiliate/v2/advertisers/10 |
FiltersName | Description |
---|
id | Required Advertiser Id Example: id=10 | body | Required Advertiser settings Example: Code Block |
---|
| {
"name": "string",
"businessUrl": "string",
"categoryId": 0
} |
| | To list categories, see /affiliate/v2/categories |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"businessUrl": "string",
"categoryId": 0,
"categoryName": "string"
} |
|
Campaigns
Expand |
---|
|
Returns advertiser's campaigns. If you do not have access to this end point, please contact your account manager. Endpoint/affiliate/v2/campaignse.g. /affiliate/v2/campaigns FiltersName | Description |
---|
page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
| advertiserId | Optional Advertiser id to filter the results Example: advertiserId=10 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when advertiserId id is not a numeric value | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the advertiser was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
}
}
],
"hasMore": true,
"page": 0
} |
Value | Meaning | Description |
---|
status | Campaign Status | The status of the campaign. | name* | Campaign Name | Name of the Campaign | start* | Campaign Start Date | Date and time of the Start of the Campaign | end | Campaign End Date | Date and time of the End of the Campaign. null if the campaign has no end date. | updated | Campaign Update date | Date and time the campaign was last updated. |
StatusValue | Description |
---|
1 | Live | 0 | Paused |
|
Expand |
---|
title | Create campaign [POST Campaigns] |
---|
|
Endpoint Tip |
---|
/api/agency/v2/campaignse.g. /api/agency/v2/campaigns |
FiltersName | Description |
---|
body | Required Campaign settings Example: Code Block |
---|
| {
"name": "string",
"start": "2022-02-15",
"end": "2022-02-15",
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
],
"strategyId": 3,
"advertiserId": 0
} |
|
Value | Meaning | Description |
---|
name* | Campaign Name | (string) Name of the Campaign | start* | Campaign Start Date | (string) Date and time of the Start of the Campaign, format: YYY-MM-DD | end | Campaign End Date | (string) Date and time of the End of the Campaign. null if the campaign has no end date, format: YYY-MM-DD | dailyBudget* | Daily Budget | (float) e.g. 150 or 150.50 | cpc* | CPC($) | (float) Cost Per Click e.g. 0.25 | trackingUrl* | Tracking Url | (string) e.g. https://track.click.com?a=2 | allowDeepLink | Allows deep linking. | (string) true or false. Default is false | geoTargeting* | Geos to target | (string) Two digit Country code e.g US, CA, GB | deviceTargeting | Device Targeting | (string) Mobile or Desktop If not passed, defaults to all | partnerChannels | comma separated ids for channel | (int) You can get channels through /affiliate/v2/channels API If not passed, defaults to all channels | strategyId* | Only accepts 3 | (int) Domain Targeting (3) | advertiserId* | Advertiser Id | (int) Advertiser Id, get list from /affiliate/v2/advertisers |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the advertiser was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
|
Returns campaign data Endpoint/affiliate/v2/campaigns/{id}e.g. /affiliate/v2/campaigns/100100 FiltersName | Description |
---|
id | Required Campaign Id Example: id=100100 |
Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
title | Change campaign status [POST Campaigns id] |
---|
|
Endpoint Tip |
---|
/affiliate/v2/campaigns/{id}e.g. /affiliate/v2/campaigns/100100 |
FiltersName | Description |
---|
id | Required Campaign Id Example: id=100100 | body | Required Flag to set the status (true | false) Example: Code Block |
---|
| {
"active": true
} |
|
Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
title | Change campaigns status in bulk |
---|
|
Endpoint Tip |
---|
/affiliate/v2/campaigns/bulk-status |
FiltersName | Description |
---|
body | Required campaignIds: List of all campaignIds to have their statuses updated. Max allowed 20 campaigns per call active: Flag to set the status (true | false) Example: Code Block |
---|
| {
"campaignIds": [
11111111,22222222,33333333,44444444
],
"active": false
} |
|
Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
title | Edit campaign [PUT Campaigns id] |
---|
|
Endpoint Tip |
---|
/affiliate/v2/campaigns/{id}e.g. /affiliate/v2/campaigns/100100 |
FiltersName | Description |
---|
id | Required Campaign Id Example: id=100100 | body | Required Campaign settings Example: Code Block |
---|
| {
"name": "string",
"end": "2022-02-15",
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Value | Meaning | Description |
---|
name | Campaign Name | (string) Name of the Campaign | start | Campaign Start Date | (string) Date and time of the Start of the Campaign, format: YYY-MM-DD | end | Campaign End Date | (string) Date and time of the End of the Campaign. null if the campaign has no end date, format: YYY-MM-DD | dailyBudget | Daily Budget | (float) e.g. 150 or 150.50 | cpc | CPC($) | (float) Cost Per Click e.g. 0.25 | trackingUrl | Tracking Url | (string) e.g. https://track.click.com?a=2 | allowDeepLink | Allows deep linking. | (string) true or false. Default is false | geoTargeting | Geos to target | (string) Two digit Country code e.g US, CA, GB | deviceTargeting | Device Targeting | (string) Mobile or Desktop If not passed, defaults to all | partnerChannels | comma separated ids for channel | (int) You can get channels through /affiliate/v2/channels API If not passed, defaults to all channels | strategyId | Only accepts 3 | (int) Domain Targeting (3) | advertiserId | Advertiser Id | (int) Advertiser Id, get list from /affiliate/v2/advertisers |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
title | Archive/Unarchive a campaign [POST Campaigns id] |
---|
|
Endpoint Tip |
---|
/affiliate/v2/campaigns/{id}/archivee.g. /affiliate/v2/campaigns/100100/archive |
FiltersName | Description |
---|
id | Required Campaign Id Example: id=100100 | body | Required Archiving status Example: Code Block |
---|
| {
"archive": true
} |
|
Value | Meaning | Description |
---|
archive | Campaign Archiving Status | (string) true or false Update archiving status, set "archive": true to archive a campaign, set "archive": false to unarchive a campaign |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
title | Archive/Unarchive campaigns in bulk |
---|
|
Endpoint Tip |
---|
/affiliate/v2/campaigns/bulk-archive |
FiltersName | Description |
---|
body | Required campaignIds: List of all campaignIds to be archived/unarchived. Max allowed 20 campaigns per call archive: Flag to set the status (true | false) Example: Code Block |
---|
| {
"campaignIds": [
11111111,22222222,33333333,44444444
],
"archive": true
} |
|
Value | Meaning | Description |
---|
archive | Campaign Archiving Status | (string) true or false Update archiving status, set "archive": true to archive a campaign, set "archive": false to unarchive a campaign |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an invalid request or payload is sent to the server | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | Returned when the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"active": true,
"status": 0,
"start": "string",
"end": "string",
"updated": "string",
"advertiser": {
"id": 0,
"name": "string"
},
"dailyBudget": 0,
"cpc": 0,
"trackingUrl": "string",
"allowDeepLink": true,
"geoTargeting": [
"string"
],
"deviceTargeting": [
"string"
],
"partnerChannels": [
0
]
} |
|
Expand |
---|
|
Get Partner Channels Endpoint/affiliate/v2/channelse.g. /affiliate/v2/channels Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| [
{
"id": 0,
"name": "string"
}
] |
|
Stats
Expand |
---|
|
Returns stats by campaign in a given period of time Endpoint/affiliate/v2/stats/by-campaigne.g. GET /affiliate/v2/stats/by-campaign?from=2021-02-01&to=2021-03-01 FiltersName | Description |
---|
from | Required Data start date, support up to two years (Y-m-d) Example: from=2022-01-01 | to | Required Data end date. (Y-m-d) Example: to=2022-01-31 | page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
| advertiserId | Optional Advertiser id to filter results Example: advertiserId=10 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When date range is not provided or the dates for the range are not in the expected format. When advertiserId id is not a numeric value | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"spend": 0,
"revenue": 0,
"cpa": 0,
"ecpc": 0,
"roas": 0,
"clicks": 0,
"impressions": 0,
"conversions": 0,
"id": 0,
"name": "string",
"advertiser": {
"id": 0,
"name": "string"
}
}
],
"hasMore": true,
"page": 0
} |
|
Expand |
---|
title | Campaigns Stats By Publisher - Channel Summary Report |
---|
|
Returns campaign stats in a given period of time grouped by publisher Endpoint/api/affiliate/v2/stats/campaigns/{id}/by-publishere.g. GET /api/affiliate/v2/stats/campaigns/100100/by-publisher?from=2021-02-01&to=2021-03-01 FiltersName | Description |
---|
id | Required Campaign id Example: id=100100 | from | Required Data start date, support up to three months(Y-m-d) Example: from=2022-01-01 | to | Required Data end date. (Y-m-d) Example: to=2022-01-31 | page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
| channel | Optional Channel Example: channel=test_channel | subid | Optional Sub-ID Example: subid=abc1234defg456 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When date range is not provided or the dates for the range are not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"spend": 0,
"revenue": 0,
"cpa": 0,
"ecpc": 0,
"roas": 0,
"clicks": 0,
"impressions": 0,
"conversions": 0,
"winRate": 0,
"bidFactor": 0,
"subId": "string",
"channel": "string",
"active": true
}
],
"hasMore": true,
"page": 0
} |
|
Publisher Bid Control
Expand |
---|
title | Set/Update Sub Id/Publisher Bid Factor [POST] |
---|
|
Sets a subId bid factor for a campaign. Endpoint/affiliate/v2/campaigns/{id}/bid-factore.g. POST affiliate/v2/campaigns/213213/bid-factor Content Type: application/json Post Data Name | Description |
---|
subId | Required Sub Id, Publisher Id of type string | bidFactor | Required Bid factor of type float e.g. 2.5, To block set it to 0 and to un-block with default bid set it to 1 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an Invalid Payload Cases: - The specified sub id does not exist - Try to block all sub ids previously allowed on the associated list. Error message: 'canNotBlockAllSubIds' This error happened when we are trying to block all sub ids from the allow list associated with the campaign. For system implementation reasons, each campaign with an associated allow list must have at least one of the list's sub ids active (bid factor > 0). If you receive this error it means that you are trying to block all sub ids for this campaign, as a suggestion it would be best just pause the campaign. | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"subId": "string",
"bidFactor": 0
} |
|
Expand |
---|
title | Bulk Set/Update Sub Id/Publisher Bid Factor [POST] |
---|
|
Sets a subId bid factor for a campaign. Endpoint/affiliate/v2/campaigns/{id}/bid-factorse.g. POST affiliate/v2/campaigns/213213/bid-factors Content Type: application/json Post Data Name | Description |
---|
subId | Required Sub Id, Publisher Id of type string | bidFactor | Required Bid factor of type float e.g. 2.5, To block set it to 0 and to un-block with default bid set it to 1 |
Sample post dataPost Body: Code Block |
---|
| {
"subIds": [
{
"subId": "subID1",
"bidFactor": 2
},
{
"subId": "subID2",
"bidFactor": 1.5
}
]
} |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an Invalid Payload Cases: Error message: 'canNotBlockAllSubIds' This error happened when we are trying to block all sub ids from the allow list associated with the campaign. For system implementation reasons, each campaign with an associated allow list must have at least one of the list's sub ids active (bid factor > 0). If you receive this error it means that you are trying to block all sub ids for this campaign, as a suggestion it would be best just pause the campaign. | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"subIds": [
{
"subId": "subID1",
"bidFactor": 2
},
{
"subId": "subID2",
"bidFactor": 1.5
}
]
} |
|
Expand |
---|
title | Get Control Lists - Allow and Block Lists [GET] |
---|
|
Returns Allow and Block lists Endpoint/affiliate/v2/control-listse.g. GET /affiliate/v2/control-lists Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"id": 0,
"name": "string",
"type": "string",
"global": true,
"updated": "string"
}
],
"hasMore": true,
"page": 0
} |
|
Expand |
---|
title | Create a control list [POST] |
---|
|
Creates a control list (Allow or Block List) Endpoint/affiliate/v2/control-listse.g. POST affiliate/v2/control-lists Content Type: application/json Post Data Name | Description |
---|
name | Required Name of list, type string | type | Required allow, block | resetBidFactors | Defaults to false true/false if you want to keep or erase and reset any existing bidfactors on the subids in this list. Please note, if the subid is not present in the allow list, you will lose your bidfactor data in both options by saving this list. | subIds | Required Array, Comma separated list of subids to include in list | campaigns | Array, comma separated list of campaigns to attach this list on creation. Key campaigns is Required but if you want to just create a list without linking to campaign, leave list empty e.g. Code Block |
---|
| "campaigns": [] |
| global | By default it’s false true/false |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an Invalid Payload | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"type": "string",
"global": true,
"updated": "string",
"campaigns": [
{
"id": 0,
"name": "string"
}
],
"subIds": [
"string"
]
} |
|
Expand |
---|
title | Get a Control List [GET] |
---|
|
Gets a list by Id Endpoint/affiliate/v2/control-lists/{id}e.g. GET affiliate/v2/control-lists/878789 Status CodesCode | Description |
---|
200 | Returned when successful | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"type": "string",
"global": true,
"updated": "string",
"campaigns": [
{
"id": 0,
"name": "string"
}
],
"subIds": [
"string"
]
} |
|
Expand |
---|
|
Updates a list (Please note that if you just want to add subids to a list, use /affiliate/v2/control-lists/{id}/append, see next end-point) Endpoint/affiliate/v2/control-lists/{id}e.g. PUT affiliate/v2/control-lists/53456 Content Type: application/json Post Data: (You can only pass the fields, you wish to update) Name | Description |
---|
name | Name of list, type string | type | allow, block | resetBidFactors | Defaults to false true/false if you want to keep or erase and reset any existing bidfactors on the subids in this list. Please note, if the subid is not present in the allow list, you will lose your bidfactor data in both options by saving this list. | subIds | Array, Comma separated list of subids to include in list | campaigns | Array, comma separated list of campaigns to attach this list on creation. | global | By default it’s false true/false |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an Invalid Payload | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"type": "string",
"global": true,
"updated": "string",
"campaigns": [
{
"id": 0,
"name": "string"
}
],
"subIds": [
"string"
]
} |
|
Expand |
---|
title | Add subIds to a list. |
---|
|
Add Sub Ids to a list Endpoint/affiliate/v2/control-lists/{id}/appende.g. PUT affiliate/v2/control-lists/654655/append Content Type: application/json Post Data: Name | Description |
---|
subIds | Array, Comma separated list of subids to add to the list e.g. ["string1", “string2“] |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | When an Invalid Payload | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 0,
"name": "string",
"type": "string",
"global": true,
"updated": "string",
"campaigns": [
{
"id": 0,
"name": "string"
}
],
"subIds": [
"string"
]
} |
|
Migration Guide:
Steps for starting using V2 version of the API, https://api.sourceknowledge.com/affiliate/v2/[endpoint], instead of https://app.sourceknowledge.com/api/agency/[endpoint].
...
No breaking change
Replace [ https://app.sourceknowledge.com/api/agency/campaign/{id}] -> [https://api.sourceknowledge.com/affiliate/v2/campaigns/{id}]
2. POST Campaign id [Changes campaign status]
No breaking change
Replace [ https://app.sourceknowledge.com/api/agency/campaign/{id}] -> [https://api.sourceknowledge.com/affiliate/v2/campaigns/{id}]
3.- PUT Campaign id [Edit campaign]
No breaking change
Replace [ https://app.sourceknowledge.com/api/agency/campaign/{id}] -> [https://api.sourceknowledge.com/affiliate/v2/campaigns/{id}]
4.- Campaigns [Return a list of campaigns]
...
The breaking change is in the Response Body. In Version 1, the advertiser is at the object’s first level with a list of campaigns associated, while in Version 2, the campaigns are at the first level and each one has the associated advertiser.
Version 1 | Version 2 |
---|
Code Block |
---|
| {
"itemsCount": 33,
"items": [
{
"id": 1750,
"name": "Example Advertiser 1",
"campaigns": [
{
"id": 100100,
"name": "Example_Campaign_1",
"status": 0,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-07-27T14:42:38+00:00"
},
{
"id": 100101,
"name": "Example_Campaign_2",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-05T19:06:13+00:00"
}
]
},
{
"id": 1751,
"name": "Example Advertiser 2",
"campaigns": [
{
"id": 100102,
"name": "Example_Campaign_1",
"status": 1,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-08-19T10:01:42+00:00"
},
{
"id": 100103,
"name": "Example_Campaign_2",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-14T19:42:33+00:00"
}
],
"hasMore":true,
"page":1
} |
| Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"id": 100100,
"name": "Example_Campaign_1",
"active": true,
"status": 0,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-07-27T14:42:38+00:00",
"advertiser": {
"id": 1750,
"name": "Example Advertiser 1"
}
},
{
"id": 100101,
"name": "Example_Campaign_2",
"active": true,
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-05T19:06:13+00:00",
"advertiser": {
"id": 1750,
"name": "Example Advertiser 1"
}
},
{
"id": 100102,
"name": "Example_Campaign_1",
"active": true,
"status": 0,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-08-19T10:01:42+00:00",
"advertiser": {
"id": 1751,
"name": "Example Advertiser 2"
}
},
{
"id": 100103,
"name": "Example_Campaign_2",
"active": true,
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-14T19:42:33+00:00",
"advertiser": {
"id": 1751,
"name": "Example Advertiser 2"
}
}
],
"hasMore": true,
"page": 0
} |
|
Replace [ https://app.sourceknowledge.com/api/agency/campaigns] -> [https://api.sourceknowledge.com/affiliate/v2/campaigns]
5. Advertiser stats [Returns advertisers stats in a given period of time.]
...
The breaking change is in the Response Body. In Version 1, the advertiser is at the object’s first level with a list of campaigns associated, while in Version 2, the campaigns are at the first level and each one has the associated advertiser.
Version 1 | Version 2 |
---|
Code Block |
---|
| {
"itemsCount": 2,
"items": [
{
"id": 1444,
"name": "Example advertiser 1",
"campaign_stats": [
{
"id": 100100,
"name": "Example_Campaign_1",
"clicks": 0,
"conversions": 0,
"cpa": 0,
"ctr": 0,
"impressions": 0,
"spend": 0,
"revenue": 0
}
]
},
{
"id": 1445,
"name": "Example advertiser 2",
"campaign_stats": [
{
"id": 100101,
"name": "Example_Campaign_2",
"clicks": 0,
"conversions": 0,
"cpa": 0,
"ctr": 0,
"impressions": 0,
"spend": 0,
"revenue": 0
}
],
"hasMore":true,
"page":1
} |
| Code Block |
---|
| {
"itemsCount": 0,
"items": [
{
"spend": 0,
"revenue": 0,
"cpa": 0,
"ecpc": 0,
"roas": 0,
"clicks": 0,
"impressions": 0,
"conversions": 0,
"id": 100100,
"name": "Example_Campaign_1",
"advertiser": {
"id": 1444,
"name": "Example advertiser 1"
}
},
{
"spend": 0,
"revenue": 0,
"cpa": 0,
"ecpc": 0,
"roas": 0,
"clicks": 0,
"impressions": 0,
"conversions": 0,
"id": 100101,
"name": "Example_Campaign_2",
"advertiser": {
"id": 1445,
"name": "Example advertiser 2"
}
}
],
"hasMore": true,
"page": 0
} |
|
Replace [https://app.sourceknowledge.com/api/agency/advertisers/stats] -> [https://api.sourceknowledge.com/affiliate/v2/stats/by-campaign]
API version 1 (deprecated)
Expand |
---|
|
Returns campaign data Endpoint/api/agency/campaign/{id}e.g. GET /api/agency/campaign/100100 FiltersName | Description |
---|
id | Required A single value of the campaign id Example: id=100100 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when date range is not provided or the dates for the range are not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 100100,
"name": "Example_Campaign_1",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-05-28T15:29:38+00:00",
"advertiser": {
"id": 1789,
"name": "Example_Advertiser_1"
},
"dailyBudget": 25.50,
"cpc": 0.05,
"trackingUrl": "https://randomtracker.com/tr?clinkID=xKX18YO-j-VqbVyA-_4ieOr2ULklKSObi4AemLx7fNWq6ujEyBa_anUTL6toPnTx3IYj&pubID=laKsuNTi0KlbZxuQz-MnRPXxSw&siteID=hfqkqdPg&placementID={sub_id}&trackingID={clickid}&loc.country={device.geo.ext.country_code2}&cost.cpc={adv_price}&url.dest={oadest}",
"allowDeepLink": true,
"geoTargeting": [
"US"
],
"deviceTargeting": [
"Mobile"
]
} |
|
Expand |
---|
|
Changes campaign status and returns campaign data Endpoint Tip |
---|
/api/agency/campaign/{id}e.g. POST /api/agency/campaign/100100 |
FiltersName | Description |
---|
id | Required A single value of the campaign id Example: id=100100 | body | Optional Changes status of campaign to either live (true) or paused (false) Example: Code Block |
---|
| {
"active": true
} |
|
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when date range is not provided or the dates for the range are not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 100100,
"name": "Example_Campaign_1",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-05-28T15:29:38+00:00",
"advertiser": {
"id": 1789,
"name": "Example_Advertiser_1"
},
"dailyBudget": 25.50,
"cpc": 0.05,
"trackingUrl": "https://randomtracker.com/tr?clinkID=xKX18YO-j-VqbVyA-_4ieOr2ULklKSObi4AemLx7fNWq6ujEyBa_anUTL6toPnTx3IYj&pubID=laKsuNTi0KlbZxuQz-MnRPXxSw&siteID=hfqkqdPg&placementID={sub_id}&trackingID={clickid}&loc.country={device.geo.ext.country_code2}&cost.cpc={adv_price}&url.dest={oadest}",
"allowDeepLink": true,
"geoTargeting": [
"US"
],
"deviceTargeting": [
"Mobile"
]
} |
|
Expand |
---|
|
Edits an existing campaign and returns campaign data Endpoint Tip |
---|
/api/agency/campaign/{id}e.g. PUT /api/agency/campaign/100100 |
FiltersName | Description |
---|
id | Required A single value of the campaign id Example: id=100100 | body | Set of fields to be updated on the campaign. You don’t need to pass all fields on the request, only the ones you want to update. You can know the field names doing a GET to the endpoint to get the current campaign data. Example: Code Block |
---|
| {
"name": "Example_Campaign_1",
"end": null,
"dailyBudget": 26.30,
"cpc": 0.7,
"trackingUrl": "https://randomtracker.com/tr?clinkID=xKX18YO-j-VqbVyA-_4ieOr2ULklKSObi4AemLx7fNWq6ujEyBa_anUTL6toPnTx3IYj&pubID=laKsuNTi0KlbZxuQz-MnRPXxSw&siteID=hfqkqdPg&placementID={sub_id}&trackingID={clickid}&loc.country={device.geo.ext.country_code2}&cost.cpc={adv_price}&url.dest={oadest}",
"allowDeepLink": true,
"geoTargeting": [
"US", "CA"
],
"deviceTargeting": [
"Mobile"
]
} |
|
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when any value is not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden | 404 | When the campaign was not found |
Sample response dataResponse Body: Code Block |
---|
| {
"id": 100100,
"name": "Example_Campaign_1",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-05-28T15:29:38+00:00",
"advertiser": {
"id": 1789,
"name": "Example_Advertiser_1"
},
"dailyBudget": 26.30,
"cpc": 0.7,
"trackingUrl": "https://randomtracker.com/tr?clinkID=xKX18YO-j-VqbVyA-_4ieOr2ULklKSObi4AemLx7fNWq6ujEyBa_anUTL6toPnTx3IYj&pubID=laKsuNTi0KlbZxuQz-MnRPXxSw&siteID=hfqkqdPg&placementID={sub_id}&trackingID={clickid}&loc.country={device.geo.ext.country_code2}&cost.cpc={adv_price}&url.dest={oadest}",
"allowDeepLink": true,
"geoTargeting": [
"US", "CA"
],
"deviceTargeting": [
"Mobile"
]
} |
|
Expand |
---|
|
Returns advertisers stats in a given period of time. Endpoint/api/agency/advertisers/statse.g. GET /api/agency/advertisers/stats?from=2021-02-01&to=2021-03-01 FiltersName | Description |
---|
from | Required Date range start. (Y-m-d) Example: from=2021-01-01 | to | Required Date range end. (Y-m-d) Example: to=2021-01-31 | page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
| advertiserId | Optional A single value of the advertiser id Example: advertiserId=1 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when date range is not provided or the dates for the range are not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 2,
"items": [
{
"id": 1444,
"name": "Example advertiser 1",
"campaign_stats": [
{
"id": 100100,
"name": "Example_Campaign_1",
"clicks": 0,
"conversions": 0,
"cpa": 0,
"ctr": 0,
"impressions": 0,
"spend": 0,
"revenue": 0
}
]
},
{
"id": 1445,
"name": "Example advertiser 2",
"campaign_stats": [
{
"id": 100101,
"name": "Example_Campaign_2",
"clicks": 0,
"conversions": 0,
"cpa": 0,
"ctr": 0,
"impressions": 0,
"spend": 0,
"revenue": 0
}
],
"hasMore":true,
"page":1
} |
AdvertiserValue | Meaning | Description |
---|
id* | Advertiser ID | ID of the Advertiser | name* | Advertiser Name | Name of the Advertiser | campaign_stats* | Advertiser Campaign stats | Array of Advertiser’s campaigns statistics |
CampaignsValue | Meaning | Description |
---|
id* | Campaign ID | ID of the Campaign | name* | Campaign Name | Name of the Campaign |
|
Expand |
---|
|
Returns a list of campaigns Endpoint/api/agency/campaignse.g. GET /api/agency/campaigns FiltersName | Description |
---|
page | Optional. Defaults to 1 Results page number. Example: page=2 Info |
---|
When the response contains “hasMore”: true, it means that more results are available. If you called the endpoint with page=1, then you need to call it again with page=2 to get more. |
| advertiserId | Optional A single value of the advertiser id Example: advertiserId=1 |
Status CodesCode | Description |
---|
200 | Returned when successful | 400 | Returned when date range is not provided or the dates for the range are not in the expected format | 401 | Returned when not authorized | 403 | Returned when access is forbidden |
Sample response dataResponse Body: Code Block |
---|
| {
"itemsCount": 33,
"items": [
{
"id": 1750,
"name": "Example Advertiser 1",
"campaigns": [
{
"id": 100100,
"name": "Example_Campaign_1",
"status": 0,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-07-27T14:42:38+00:00"
},
{
"id": 100101,
"name": "Example_Campaign_2",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-05T19:06:13+00:00"
}
]
},
{
"id": 1751,
"name": "Example Advertiser 2",
"campaigns": [
{
"id": 100102,
"name": "Example_Campaign_1",
"status": 1,
"start": "2021-02-03T05:00:00+00:00",
"end": null,
"updated": "2021-08-19T10:01:42+00:00"
},
{
"id": 100103,
"name": "Example_Campaign_2",
"status": 0,
"start": "2021-05-26T04:00:00+00:00",
"end": null,
"updated": "2021-07-14T19:42:33+00:00"
}
],
"hasMore":true,
"page":1
} |
Value | Meaning | Description |
---|
status | Campaign Status | The status of the campaign. | name* | Campaign Name | Name of the Campaign | start* | Campaign Start Date | Date and time of the Start of the Campaign | end | Campaign End Date | Date and time of the End of the Campaign. null if the campaign has no end date. | updated | Campaign Update date | Date and time the campaign was last updated. |
StatusValue | Description |
---|
1 | Live | 0 | Paused |
|
...