Creatives
List Creatives
get
/campaigns/{id}/creatives
Path Parameters
| id int, required |
The ID of the campaign. |
Query Parameters
| limit int |
The number of items returned in the response. Defaults to 100. |
| offset int |
The number of items to skip before starting to return results. Defaults to 0. |
Example Request
curl "https://{yourname}.api.adglare.app/v2/campaigns/{id}/creatives"
-H "Authorization: Bearer {api_key}"
-H "Authorization: Bearer {api_key}"
HTTP 200 Example Response
Get a single Creative
get
/campaigns/{id}/creatives/{id}
Path Parameters
| id int, required |
The ID of the campaign. |
| id int, required |
The ID of the creative. |
Example Request
curl "https://{yourname}.api.adglare.app/v2/campaigns/{id}/creatives/{id}"
-H "Authorization: Bearer {api_key}"
-H "Authorization: Bearer {api_key}"
HTTP 200 Example Response
Add a Creative
post
/campaigns/{id}/creatives
Path Parameters
| id int, required |
The ID of the campaign. |
Request Body (JSON)
| name string, required |
The name of the campaign. |
| ad_type string, required |
The ad type. See the table here below. |
List of ad types
For Display Ad campaigns:- image
- code
- video
- zip
- external
- json
- video
- url
- wrapper
- url
Example Request
curl "https://{yourname}.api.adglare.app/v2/campaigns/{id}/creatives"
-X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer {api_key}"
-d '{
"name": "My Creative",
"ad_type": "image"
}'
-X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer {api_key}"
-d '{
"name": "My Creative",
"ad_type": "image"
}'
HTTP 201 Example Response
Update a Creative
put
/campaigns/{id}/creatives/{id}
Path Parameters
| id int, required |
The ID of the campaign. |
| id int, required |
The ID of the creative. |
Request Body (JSON)
| name string, required |
The name of the creative. |
| is_active boolean, required |
True if the creative is active. |
| data object, required |
The schema of the data object depends on the creative's ad_type. See below. |
| data.alt_text string |
The alt text on the image. |
| data.filehash string, required |
The name of the media file. |
| data.target_window string |
The target window on clickthrough: _blank, _top, _self, _parent. |
| data.use_iframe boolean |
Writes the ad in an iframe. |
| data.width int, required |
The width of the image. |
| data.height int, required |
The height of the image. |
| data.landing_page string |
The landing page URL. |
| data.ad_verification_code string |
Any 3p ad verification code that has to be executed when loading the ad. |
| delivery object |
The delivery object. |
| delivery.end int |
The end date/time as a UNIX timestamp. Leave blank to run infinitely. |
| delivery.start int, required |
The start date/time as a UNIX timestamp. |
| targeting object |
The targeting object. |
| targeting.devices array |
Either: desktop, tablet, mobile |
| targeting.geo object |
The geotargeting object. |
| targeting.geo.type string, required |
Either: include, exclude |
| targeting.geo.locations object, required |
The geotargeting locations object. |
| targeting.geo.locations.countries array |
An array with 2-letter country codes, uppercased. |
| targeting.languages object |
An array with 2-letter country codes. |
| targeting.languages.type string, required |
Either: include, exclude |
| targeting.languages.items array, required |
An array with 2-letter language codes, lowercased. |
| targeting.keywords array |
The keyword targeting array. Each subarray is an AND. |
| targeting.keywords[] array, required |
An array with keywords. Each keyword is an OR. |
| targeting.keyvalues array |
The key/value targeting array. |
| targeting.keyvalues[] array, required |
Each object inside is an AND. |
| targeting.keyvalues[][] object, required |
A key/value targeting object. |
| targeting.keyvalues[][].key string, required |
The key name of your key/value pair. |
| targeting.keyvalues[][].operator string, required |
The operator that has to be used. |
| targeting.keyvalues[][].value string, required |
The value of your key/value pair. |
Example Request
curl "https://{yourname}.api.adglare.app/v2/campaigns/{id}/creatives/{id}"
-X PUT
-H "Content-Type: application/json"
-H "Authorization: Bearer {api_key}"
-d '{
"name": "My Creative",
"ad_type": "image",
"is_active": true,
"data": {
"filehash": "abcde_5hvh6hpf.png",
"width": 250,
"height": 250,
"alt_text": "",
"use_iframe": true,
"landing_page": "https://www.google.com",
"ad_verification_code": ""
},
"delivery": {
"start": 1770588000,
"end": 0
},
"targeting": {
"geo": {
"locations": {
"countries": ["FRA"]
},
"type": "include"
},
"languages": {
"items": "fr",
"type": "include"
},
"keywords": [["cars",
"bikes"],
["red"]],
"keyvalues": [[{
"key": "car",
"value": "audi",
"operator": "="
},
{
"key": "sales",
"value": "100",
"operator": ">"
}]]
}
}'
-X PUT
-H "Content-Type: application/json"
-H "Authorization: Bearer {api_key}"
-d '{
"name": "My Creative",
"ad_type": "image",
"is_active": true,
"data": {
"filehash": "abcde_5hvh6hpf.png",
"width": 250,
"height": 250,
"alt_text": "",
"use_iframe": true,
"landing_page": "https://www.google.com",
"ad_verification_code": ""
},
"delivery": {
"start": 1770588000,
"end": 0
},
"targeting": {
"geo": {
"locations": {
"countries": ["FRA"]
},
"type": "include"
},
"languages": {
"items": "fr",
"type": "include"
},
"keywords": [["cars",
"bikes"],
["red"]],
"keyvalues": [[{
"key": "car",
"value": "audi",
"operator": "="
},
{
"key": "sales",
"value": "100",
"operator": ">"
}]]
}
}'
HTTP 204 Example Response
Delete a Creative
delete
/campaigns/{id}/creatives/{id}
Path Parameters
| id int, required |
The ID of the campaign. |
| id int, required |
The ID of the creative. |
Example Request
curl "https://{yourname}.api.adglare.app/v2/campaigns/{id}/creatives/{id}"
-X DELETE
-H "Authorization: Bearer {api_key}"
-X DELETE
-H "Authorization: Bearer {api_key}"
HTTP 204 Example Response
