Affiliate Network API Documentation

Affiliate Network API Documentation

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.

The provided key serves as your access token and must be included in the X-API-KEY header of each API request.

curl -X GET "https://api.sourceknowledge.com/affiliate/v2/advertisers" -H "accept: application/json" -H "X-API-KEY: [Your API key]"

429 Too many requests/Rate Limits: API servers expect no more than 200 requests/minute & same request retry is limited to 10 times/minute. Any call beyond these rate limits will result in HTTP 429 error

503 Service Unavailable – Returned during maintenance or high load. Retry later to process the request.

Transport Layer Security (TLS) Protocol Required Version: 1.3

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.

Endpoints

Advertisers

Returns advertiser categories. If you do not have access to this end point, please contact your account manager.

Endpoint

/affiliate/v2/categories

e.g. /affiliate/v2/categories

Status Codes

Code

Description

Code

Description

200

Returned when successful

401

Returned when not authorized

403

Returned when access is forbidden

Sample response data

Response Body:

[ { "id": 0, "name": "string" } ]

Returns Advertisers

Endpoint

/affiliate/v2/advertisers

e.g. /affiliate/v2/advertisers

Filters

Name

Description

Name

Description

page

Optional. Defaults to 1

Results page number.

Example: page=2

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 Codes

Code

Description

Code

Description

200

Returned when successful

401

Returned when not authorized

403

Returned when access is forbidden

Sample response data

Response Body:

{ "itemsCount": 0, "items": [ { "id": 0, "name": "string", "businessUrl": "string", "categoryId": 0, "categoryName": "string" } ], "hasMore": true, "page": 0 }

Endpoint

/affiliate/v2/advertisers

e.g. /affiliate/v2/advertisers

Filters

Name

Description

Name

Description

body

Required

Advertiser settings

Example:

{ "name": "string", "businessUrl": "string", "categoryId": 0 }

 

To get list categories with ids see /affiliate/v2/categories

Status Codes

Code

Description

Code

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 data

Response Body:

{ "id": 0, "name": "string", "businessUrl": "string", "categoryId": 0, "categoryName": "string" }

Returns detailed information about the advertiser

Endpoint

/affiliate/v2/advertisers/{id}

e.g. /affiliate/v2/advertisers/10

Filters

Name

Description

Name

Description

id

Required

Advertiser Id

Example: id=10

Status Codes

Code

Description

Code

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 data

Response Body:

{ "id": 0, "name": "string", "businessUrl": "string", "categoryId": 0, "categoryName": "string" }

Endpoint

/affiliate/v2/advertisers/{id}

e.g. /affiliate/v2/advertisers/10

Filters

Name

Description

Name

Description

id

Required

Advertiser Id

Example: id=10

body

Required

Advertiser settings

Example:

{ "name": "string", "businessUrl": "string", "categoryId": 0 }

 

To list categories, see /affiliate/v2/categories

Status Codes

Code

Description

Code

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 data

Response Body:

{ "id": 0, "name": "string", "businessUrl": "string", "categoryId": 0, "categoryName": "string" }

 

Campaigns

Returns advertiser's campaigns. If you do not have access to this end point, please contact your account manager.

Endpoint

/affiliate/v2/campaigns

e.g. /affiliate/v2/campaigns

Filters

Name

Description

Name

Description

page

Optional. Defaults to 1

Results page number.

Example: page=2

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 Codes

Code

Description

Code

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 data

Response Body:

{ "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

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.

Status

Value

Description

Value

Description

1

Live

0

Paused

Endpoint

/api/agency/v2/campaigns

e.g. /api/agency/v2/campaigns

Filters

Name

Description

Name

Description

body

Required

Campaign settings

Example:

{ "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

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 Codes

Code

Description

Code

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 data

Response Body:

{ "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 ] }

Returns campaign data

Endpoint

/affiliate/v2/campaigns/{id}

e.g. /affiliate/v2/campaigns/100100

Filters

Name

Description

Name

Description

id

Required

Campaign Id

Example: id=100100

Status Codes

Code

Description

Code

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 data

Response Body:

{ "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 ] }

Endpoint

/affiliate/v2/campaigns/{id}

e.g. /affiliate/v2/campaigns/100100

Filters

Name

Description

Name

Description

id

Required

Campaign Id

Example: id=100100

body

Required

Flag to set the status (true | false)

Example:

{ "active": true }

Status Codes

Code

Description

Code

Description

200

Returned when successful

401

Returned when not authorized

403

Returned when access is forbidden

404