Select Page

2. Campaigns

Endpoints

Endpoint: GET /campaigns
Endpoint: GET /campaigns/{id}
Endpoint: PATCH /campaigns/{id}/{play|pause}
Endpoint: PATCH /campaigns/{id}
Endpoint: PATCH /campaigns/{id}/targeting-action

 

List campaigns

Endpoint: GET /campaigns

Extra filter options:
&show_deleted=1
also show deleted campaigns
todo: add more filtering options (all per geo, all per source type, all per status)

 

Show campaign info

Endpoint: GET /campaigns/{id}

Also returns a campaign if deleted. Can be checked by reading out the deleted_at parameter.

If there is a “-” before the option it means that option is excluded (blacklisted). For example in the following response Chrome and Firefox are excluded, while NL and BE are included (whitelisted).

{
"id": 123,
"name": "testest",
"media_types": “mainstream”,
"source_type": "popunder",
"bid_type": "cpm",
"device_types": null,
"platforms": null,
"browsers": [
"-Chrome",
"-Firefox"
],
"countries": [
"NL",
"BE"
],
"carriers": null,
"banner_id": null,
"url": "url.com”
"times": null,
"labels": null,
"min_age": null,
"max_age": 10,
"bid_price": 2,
"total_budget": 100,
"daily_budget": 25,
"total_spent": "0.0000",
"daily_spent": "0.0000",
"status": "rejected",
"status_reason": "Rejected by manager",
"created_at": "2019-03-19 17:45:57",
"updated_at": "2020-04-16 15:11:12",
"deleted_at": null
}

 

Target Options

browsers AndroidBrowser, Chrome, Crosswalk, Edge, Facebook, Firefox, GenericBrowser, IE, LINE, MiuiBrowser, Mozilla,Opera, PlayStation4Browser, Safari, SamsungBrowser, UCBrowser, WebView, YandexBrowser
countries two letter country code in full capital.
For example “NL” or “BE”
To target everything you can set “Global”
carriers The format to target specific carriers is as follows:
“{country code} {carrier name}”For example: “TR Vodafone” or “US Sprint””null” or “” will target all carriersFor Wifi you can use “WiFi”A full list of targeting options can be found here
sites The site_id as found in your stats report.
For example “10001”
device_types mobile, tablet, desktop
platforms Android, BlackBerryOS, ChromeOS, iOS, Linux, OS X, Windows, WindowsMobileOS, WindowsPhoneOS,
categories mainstream, adult

 

Pause or Play campaign

Endpoint: PATCH /campaigns/{id}/{play|pause}

 

Update campaign settings

Endpoint: PATCH /campaigns/{id}

Accepted options: “name”, “min_age”, “max_age”, “bid_price”, “total_budget”, “daily_budget”, “sites_targeting”

Example request to set total budget to 100USD and daily budget to 25USD

PATCH /api/campaigns/123 HTTP/1.1
Host: panel.noviclick.com
api-token: abc123
Content-Type: application/json
Accept: /
Content-Length: 45

Request body:

{
"total_budget": 100,
"daily_budget": 25
}

Excluding targeting options

Endpoint: PATCH /campaigns/{id}/targeting-action

Accepted options: “browsers”, “countries”, “device_types”, “carriers”, “sites”, “banner_ids”
Accepted include options: “sites”

{
"exclude" :
{
"browsers": ["Chrome", "Firefox"],
"countries": ["NL", "BE"]
}
}

Note: Including targeting options via the API is not available yet, but will work in exactly the same way.

 

Blacklisting / whitelisting sites

For creating a blacklist or whitelist of sites to run on we can combine two calls.

First we have to set the sites_targeting to the type of campaign we want to run. If you want to run a whitelist set sites_targeting to “whitelist” and if you want to run a blacklist campaign set the sites_targeting to “blacklist”. This only has to be done once. We can use the campaign update endpoint for this with the following content body:

Step 1

Endpoint: PATCH /campaigns/{id}

Request body:

{
"sites_targeting": “blacklist”
}

After setting the sites_targeting to the desired value you can make a request to the targeting options endpoint to manage the list. Either use the “exclude” option to remove items from the list or the” include” option to include new items to the chosen list type as follows:

Step 2

Endpoint: PATCH /campaigns/{id}/targeting-action

Accepted include options: “sites”

{
"include" :
{
"sites": ["1", "2", "3"]
}
}

Please keep in mind that to add sites to your blacklist the “include” option should be used and to remove sites from the blacklist the “exclude” option should be used.