Advertiser Campaign API
This api allows advertiser to view their campaigns in json format
Authentication
You must authenticate your request using your api authentication token.
You can get your authentication token from your user profile in the User Information section.
In order to authenticate your requests using the auth token you need to provide the following http header
curl <url> -H 'Authorization: Token <auth_token>'
List all campaigns
URL
https://dashboard.instal.com/advertiser/api/v1/campaigns
Method
GET
URL Params
Required | Name | Type | Description |
---|---|---|---|
optional | status |
string | Campaign status. Allowed values: RUNNING, PAUSED, DELETED, REJECTED, EXPIRED, NOTDELETED. Default show all campaigns |
optional | page |
int | The page of results to return |
optional | page_size |
int | Number of items per page |
Pagination
This API provides a defaults of maximum 10 items per request, you can change this behaviour with the page_size
param.
With the optional page
URL param you can specify the page of results to return.
You can find link to the next and previous results page in the next
and previous
response attribute value.
Success Response
Response code: 200
Content-Type: application/json
The json object has the following top level structure:
{
"count": 2,
"next": null,
"numpages": 1,
"previous": null,
"results": [...]
}
Attribute | Type | Description |
---|---|---|
count |
int | Total campaigns count |
next |
string | Link to next results page. Can be null |
numpages |
int | Number of available pages |
previous |
string | Link to previous results page. Can be null |
results |
array | Array of campaigns object |
Objects in the results
array will have the following structure:
{
"application": "My application",
"budget": 1000.0,
"campaign_type": "CPI",
"countries": {
"IT": "Italy",
"US": "USA"
},
"daily_cap": 10.0,
"destination_url": "http://www.trackurl.com/var={CLICK_ID}",
"id": 42,
"is_incentivized": false,
"name": "My campaign",
"os": "ANDROID",
"os_min_version": 7.0,
"payout": 1.0,
"restrictions": {
"9": {
"name": "Adult traffic",
"description": "Any type of traffic related to adult, porn or sexy contents is not allowed."
}
},
"start_date": "2018-04-10T13:57:59Z",
"status": "RUNNING",
"stop_date": "2018-04-13T08:00:00Z",
}
Attribute | Type | Description |
---|---|---|
application |
string | Application name |
budget |
number | Total campaign budget |
campaign_type |
string | Campaign type, Can be CPC, CPI, CPA |
countries |
object | Countries associated with this campaign. Items key is a two-letter country code (ISO 3166-1 alpha-2) while value is the country name |
daily_cap |
number | Campaign daily cap |
destination_url |
string | Campaign destination url |
id |
int | Campaign id |
is_incentivized |
boolean | Campaign can allows incent traffic |
name |
string | Campaign name |
os |
string | Operative system associated with this campaign |
os_min_version |
number | Minimum operative system version for this campaign |
payout |
number | Payout of the campaign |
restrictions |
object | Kind of restrictions for this campaigns. Items key is the restriction id, value is an object with restriction name and description |
start_date |
string | Campaign start date, in ISO 8601 format |
status |
string | Status of the campaign. Can be RUNNING, PAUSED, DELETED, REJECTED, EXPIRED |
stop_date |
string | Campaign stop date, in ISO 8601 format |
Error Response
Code | Response | Description |
---|---|---|
403 | {"detail": "Authentication credentials were not provided."} | Request doesn't contain authentication credentials or the user is not linked to an advertiser |
400 | {"status": ["Select a valid choice. WrongStatus is not one of the available choices."]} | Wrong status value |
405 | {u'detail': u"Method 'POST' not allowed."} | Only GET method is allowed |
Sample Call
Request example using curl:
curl -H "Authorization: Token <auth_token>" 'https://dashboard.instal.com/advertiser/api/v1/campaigns?status=RUNNING'
Single campaign
URL
https://dashboard.instal.com/advertiser/api/v1/campaigns/:id
Method
GET
Success Response
Response code: 200
Content-Type: application/json
The json object has the following structure:
{
"application": "My application",
"budget": 1000.0,
"campaign_type": "CPI",
"countries": {
"IT": "Italy",
"US": "USA"
},
"daily_cap": 10.0,
"destination_url": "http://www.trackurl.com/var={CLICK_ID}",
"id": 42,
"is_incentivized": false,
"name": "My campaign",
"os": "ANDROID",
"os_min_version": 7.0,
"payout": 1.0,
"restrictions": {
"9": {
"name": "Adult traffic",
"description": "Any type of traffic related to adult, porn or sexy contents is not allowed."
}
},
"start_date": "2018-04-10T13:57:59Z",
"status": "RUNNING",
"stop_date": "2018-04-13T08:00:00Z",
}
Attribute | Type | Description |
---|---|---|
application |
string | Application name |
budget |
number | Total campaign budget |
campaign_type |
string | Campaign type, Can be CPC, CPI, CPA |
countries |
object | Countries associated with this campaign. Items key is a two-letter country code (ISO 3166-1 alpha-2) while value is the country name |
daily_cap |
number | Campaign daily cap |
destination_url |
string | Campaign destination url |
id |
int | Campaign id |
is_incentivized |
boolean | Allows incent traffic |
name |
string | Campaign name |
os |
string | Operative system associated with this campaign |
os_min_version |
number | Minimum operative system version for this campaign |
payout |
number | Payout of the campaign |
restrictions |
object | Kind of restrictions for this campaigns. Items key is the restriction id, value is an object with restriction name and description |
start_date |
string | Campaign start date, in ISO 8601 format |
status |
string | Status of the campaign. Can be RUNNING, PAUSED, DELETED, REJECTED, EXPIRED |
stop_date |
string | Campaign stop date, in ISO 8601 format |
Error Response
Code | Response | Description |
---|---|---|
403 | {"detail": "Authentication credentials were not provided."} | Request doesn't contain authentication credentials or the user is not linked to an advertiser |
404 | {"detail": "Not found"} | No campaign with given id |
405 | {u'detail': u"Method 'POST' not allowed."} | Only GET method is allowed |
Sample Call
Request example using curl:
curl -H "Authorization: Token <auth_token>" 'https://dashboard.instal.com/advertiser/api/v1/42'