The Affiliate.com API provides many API resources that enable you to retrieve your channels, snippets, and offers, and perform a product search.Getting started guide#
To start using the Affiliate.com API:You must use a valid API Token to send requests to the API endpoints. You can get your API token from https://my.affiliate.com/ The API has rate and usage limits which are determined by the API program you have subscribed.
The API only responds to HTTPS-secured communications. Any requests sent via HTTP return an HTTP 301 redirect to the corresponding HTTPS resources.
The API returns request responses in JSON format. When an API request returns an error, it is sent in the JSON response as an error key.
Authentication#
API requests must be authenticated by passing a token in the Authorization HTTP request header. Please go to https://my.affiliate.com to create an API Token.Afterward, include this API Token in the header of each API request as follows:Authorization: Bearer {YOUR_AUTH_KEY}You should keep your team access tokens secure and private. Never put them in publically accessible places, such as in client-side code or public code repositories.Authentication error response#
If an API key is missing, malformed, or invalid, you will receive an HTTP 401 Unauthorized response code.Rate and usage limits#
API access rate limits apply at a per-API key basis in unit time. The limit is determined by your suscription and is measured in requests per minute. Also, depending on your plan, you may have usage limits. If you exceed the requests per minute limit, your request will return an HTTP 429 Too Many Requests status code. If you attempt to exceed the usage limit, you will get a HTTP 422 Unprocessable Entity.503 response#
An HTTP 503 response from our servers indicates there is an unexpected spike in API access traffic. The server is usually operational within the next five minutes. If the outage persists or you receive any other form of an HTTP 5XX error, contact support.Common Parameters#
For all the API endpoints, the following parameters exist:| Parameter Name | Type | Required | Description |
|---|
fields | string | No | Limit to the return to the fields specified |
page | integer | No | The page number to retrieve. Defaults to 1. |
per_page | integer | No | The number of items per page. Defaults to 100. |
Additional Network Credentials#
For certain specific networks, the API network configuration requires additional parameters to retrieve their products and/or promotions. Here is a table and the additional information required:| Network Name | Parameter | Example |
|---|
| Adservice | mid | "1200": {
"affiliate_id": "123abc",
"sub_id": "123abc",
"mid": "a_good_mid"
}
|
| The Affiliate Gateway | site_id | "650": {
"affiliate_id": "123abc",
"sub_id": "123abc",
"sid": "123456"
}
|
| Belboon | adspace_id | "253": {
"affiliate_id": "123abc",
"sub_id": "123abc",
"adspace_id": "123456"
}
|
| Effiliation | api_key | "805": {
"affiliate_id": "123abc",
"sub_id": "123abc",
"api_key": "a_good_api_key"
}
|
| Partnerize | application_key,
user_api_key,
publisher_id | "811": {
"affiliate_id": "123abc",
"sub_id": "123abc",
"application_key": "a_good_application_key",
"user_api_key": "a_good_user_api_key",
"publisher_id": "a_good_publisher_id"
}
|
When these parameters are supplied but are missing all the relevant key/value pairs, you will recieve a 422 error which will indicate the missing item(s). Modified at 2024-08-02 14:38:08