AdButler API v2.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
AdButler is designed to provide either the Publisher, Advertiser, or an Ad Network the ability to schedule and rotate ads with relevant targeting. AdButler is a powerful tool that ensures your ads are consistent, specific, and fast. It's easy to get started using the AdButler API because it is based on predictable, resource-oriented URLs. All API responses, including errors, return standard JSON. All errors are semantically mapped to HTTP response codes.
You are encouraged to explore the API during the development phase using the test mode API keys. Requests made with test mode credentials never use our ad serving infrastructure and, therefore, incur no cost. Once your product is ready for launch, just swap the test mode API key with the live mode API key. You cannot switch between key modes, just use the appropriate key.
Get an AdButler API key by visiting the AdButler API Settings page (Settings → API Settings).
API Endpoint
https://api.adbutler.com
Base URLs:
Email: Support
What's New
Version 2.0
Before we go any further, we should say that none of these new changes will apply to the /v1/
endpoints. Version 1 of the AdButler API is, and will stay, the same as it was in March of 2019. You can see the documentation of version 1 here; However, this documentation will no longer be updated.
To take advantage of our API's future features and upgrades, we recommend transitioning to Version 2.0.
Terminology Changes
We’re making some important updates to the wording we use for key features and functions in the AdButler app and API.
Every type of ad or response that is serving to a zone will be called an “ad item”. This term will be used to represent all forms of display ads, VAST video ads, custom data responses, or programmatic 3rd party bid requests. See the table below for a complete outline of the changes being made.
V1.0 Endpoint | V2.0 Endpoint | Examples |
---|---|---|
/banners |
/ad-items |
/banners/image is now /ad-items/image . The same goes for all of the types of ad-items. |
/campaigns/banner |
/campaigns/standard |
The object returned has also changed from banner_campaign to standard_campaign |
/zones/banner |
/zones/standard |
The object returned has also changed from banner_zone to standard_zone |
/vast-banners |
/vast-ad-items |
The object returned has also changed from vast_banner to vast_ad_item |
Authentication
- HTTP Authentication, scheme: basic
Include your secret API key in the Authorization header when making any request.
--header 'Authorization: Basic {API_KEY}'
xhr.setRequestHeader("Authorization", "Basic {API_KEY}");
request["Authorization"] = 'Basic {API_KEY}'
headers = { 'Authorization': "Basic {API_KEY}" }
.header("Authorization", "Basic {API_KEY}")
req.Header.Add("Authorization", "Basic {API_KEY}")
AdButler uses secret API keys to allow access to the API. You can register a new AdButler API key by visiting the AdButler API Settings page (Settings → API Settings). The API Settings page also lets you manage your existing API keys. Never share your secret API keys on public websites or in the client-side code.
You must include secret API key in all your API requests. API requests without the secret API key will fail. Language bindings take care of that for you once you initialize them with your secret API key. This is another incentive to use the appropriate language bindings whenever possible.
Always send requests over HTTPS. Language bindings does that for you automatically. Requests over HTTP will fail and you run the risk of exposing your secret API key. If you believe that your secret API key has been compromised, then go to AdButler API Settings page and delete the compromised API key and create a new one.
Expanding Resources
Example GET on the /placements endpoint using
expand="all"
.
{
"object": "placement",
"self": "/v2/placements/1234",
"id": 1234,
"advertisement": [
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/456",
"id": 456,
"advertiser": 789,
...
}
],
...
"schedule": [
{
"object": "schedule",
"self": "/v2/campaigns/standard/369",
"id": 369,
...
}
],
...
"zone": [
{
"object": "standard_zone",
"self": "/v2/zones/standard/258",
"id": 258,
"publisher": 147,
...
}
],
...
}
Some resources reference other resources using their identifier (ID). For example, a placement resource references a particular zone and advertisement. Sometimes you need the details of the referenced resource, irrespective of the response size. Maybe you are primarily concerned with avoiding multiple network requests to minimize the latency caused by network round trips. In such cases, the ability to expand referenced resources might come in handy.
AdButler API lets you expand the referenced resources in place, using the expand
query parameter with the value all.
You can also restrict expansion to certain fields by using a comma separated list of fields as the value to the expand
query parameter. (e.g. advertisement,zone)
Note: irrelevant fields have been "ellipsed".
Depth
Example GET on the /placements endpoint using
expand="all"
anddepth=5
.
{
"object": "placement",
"self": "/v2/placements/1234",
"id": 1234,
"advertisement": [
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/456",
"id": 456,
"advertiser": [
{
"object": "advertiser",
"self": "/v2/advertisers/789",
"id": 789,
...
}
]
...
}
],
...
"schedule": [
{
"object": "schedule",
"self": "/v2/campaigns/standard/369",
"id": 369,
...
}
],
...
"zone": [
{
"object": "standard_zone",
"self": "/v2/campaigns/standard/258",
"id": 258,
"publisher": [
{
"object": "publisher",
"self": "/v2/advertisers/147",
"id": 147,
...
}
]
...
}
],
...
}
You can further expand the resources within the already expanded resources by specifying depth
alongside expand
. depth
controls the extent to which the objects should be expanded within a resource. The maximum value of depth
is 5 and defaults to 1 if unspecified.
Standard Banner Dimensions
When it comes to deciding about the size of your image, flash, custom HTML, or rich media ad-item, you will most likely be using dimensions commonly used for banner advertisements across the Web. For your immediate reference and convenience, standard web banner dimensions are tabulated below. All measurements are given in pixels.
Popular Name | Width (px) | Height (px) |
---|---|---|
3:1 Rectangle | 300 | 100 |
Billboard | 970 | 250 |
Button 1 | 120 | 90 |
Button 2 | 120 | 60 |
Full Banner | 468 | 60 |
Half Banner | 234 | 60 |
Half Page Ad | 300 | 600 |
Large Rectangle | 336 | 280 |
Leaderboard | 728 | 90 |
Medium Rectangle | 300 | 250 |
Micro Bar | 88 | 31 |
Pop-Under | 720 | 300 |
Rectangle | 180 | 150 |
Super Leaderboard | 970 | 90 |
Square Pop-Up | 250 | 250 |
Square Button | 125 | 125 |
Skyscraper | 120 | 600 |
Vertical Rectangle | 240 | 400 |
Vertical Banner | 120 | 240 |
Wide Skyscraper | 160 | 600 |
Mobile Leaderboard | 320 | 50 |
Mobile Interstitial | 320 | 480 |
IAB Content Categories
A list of IAB Content Categories that could describe the content or purpose of a given site, app, or even advertisements.
Category | IAB Code |
---|---|
Arts & Entertainment | IAB1 |
Automotive | IAB2 |
Business | IAB3 |
Careers | IAB4 |
Education | IAB5 |
Family & Parenting | IAB6 |
Health & Fitness | IAB7 |
Food & Drink | IAB8 |
Hobbies & Interests | IAB9 |
Home & Garden | IAB10 |
Government & Politics | IAB11 |
News | IAB12 |
Personal Finance | IAB13 |
Society | IAB14 |
Science | IAB15 |
Pets | IAB16 |
Sports | IAB17 |
Style & Fashion | IAB18 |
Tech & Computing | IAB19 |
Travel | IAB20 |
Real Estate | IAB21 |
Shopping | IAB22 |
Religion & Spirituality | IAB23 |
Uncategorized | IAB24 |
Non-Standard Content | IAB25 |
Illegal Content | IAB26 |
API Errors
AdButler API uses conventional HTTP response codes to indicate the success or failure of a request, listed and described in the table below.
Code | Meaning |
---|---|
200 | OK — Everything worked as expected. |
400 | Bad Request — The request was unacceptable, often due to missing a required parameter. |
402 | Request Failed — parameters were valid but the request failed. |
403 | Forbidden — An issue with the API key or AdButler account, or not requesting over HTTPS. |
404 | Not Found — The requested resource was not found. |
405 | Method Not Allowed — An action was attempted on an object that doesn't exist or cannot be modified |
409 | Conflict — Resource cannot be modified, or the resource already exists. |
410 | Gone — The resource or endpoint requested has been removed from our servers. |
429 | Too Many Requests — You're sending too many requests. Slow down! |
500 | Internal Server Error — We had a problem with our server. Try again after a few minutes. |
501 | Not Implemented — The requested method is not supported by our servers and will not be handled. |
503 | Service Unavailable — We're temporarily offline for maintanance. Please try again later. |
Ad Items (All)
Get a List of All Ad Items
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/ad-items",
"data": [
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "image_ad_item",
"self": "/v2/ad-items/image/675265899",
"id": 675265899,
"flexible_type": 0,
"is_self_serve": "true"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | ad_item_list |
Ad Items / Custom HTML
If you need to serve a third-party advertisement from an ad network or another advertiser, or find yourself needing to do something extremely custom that you cannot achieve with traditional display advertising, the Custom HTML Ad Item is here to help.
Custom HTML Ad Items effectively give you the freedom to implement virtually any type of advertisements you need through the use of AdButler's ad serving macros and a text box.
In general, ad items are assigned to an advertiser campaign, and in turn the campaign to a zone. Ad Items may be assigned to publishers directly if they related directly to that publisher (or are planned to be default/backfill ads).
Get a List of Custom HTML Ad Items
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/custom-html \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/custom-html");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/custom-html", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/custom-html")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/custom-html
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/ad-items/custom-html",
"data": [
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765,
"is_self_serve": "true"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | custom_html_ad_item_list |
Create a Custom HTML Ad Item
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/ad-items/custom-html \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","custom_html":"<div> ... </div>","expand_horizontal_direction":"left","expand_vertical_direction":"none"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/ad-items/custom-html");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/ad-items/custom-html", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/ad-items/custom-html")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /ad-items/custom-html
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | custom_html_ad_item_post | false | none |
» name | body | string | true | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | true | The height of the ad item. See standard banner dimensions. |
» width | body | integer | true | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» custom_html | body | string | true | The HTML content of the ad item. |
» expand_horizontal_direction | body | string | false | Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none". |
» expand_vertical_direction | body | string | false | Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none". |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | custom_html_ad_item_get |
Get a Single Custom HTML Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/custom-html/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/custom-html/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/custom-html/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/custom-html/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/custom-html/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | custom_html_ad_item_get |
Update a Custom HTML Ad Item
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/ad-items/custom-html/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","custom_html":"<div> ... </div>","expand_horizontal_direction":"left","expand_vertical_direction":"none"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/ad-items/custom-html/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/ad-items/custom-html/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/ad-items/custom-html/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html/0"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"custom_html\":\"<div> ... </div>\",\"expand_horizontal_direction\":\"left\",\"expand_vertical_direction\":\"none\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /ad-items/custom-html/{id}
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to update. |
body | body | custom_html_ad_item_put | false | none |
» name | body | string | false | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | false | The height of the ad item. See standard banner dimensions. |
» width | body | integer | false | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» custom_html | body | string | false | The HTML content of the ad item. |
» expand_horizontal_direction | body | string | false | Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none". |
» expand_vertical_direction | body | string | false | Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none". |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"custom_html": "<div> ... </div>",
"expand_horizontal_direction": "left",
"expand_vertical_direction": "none",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "custom_html_ad_item",
"self": "/v2/ad-items/custom-html/985124765",
"id": 985124765,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | custom_html_ad_item_get |
Delete a Custom HTML Ad Item
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/ad-items/custom-html/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/ad-items/custom-html/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/ad-items/custom-html/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/ad-items/custom-html/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /ad-items/custom-html/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Get Conversion Tag for Custom HTML Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/custom-html/0/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/custom-html/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/custom-html/0/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/custom-html/0/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/custom-html/0/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/custom-html/0/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/custom-html/{id}/conversion-tag
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get a conversion tag for. |
Example responses
default Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
},
"url": "/v2/ad-items/custom-html/985124765/conversion-tag"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | custom_html_ad_item_conversion_tag |
Ad Items / Flash [DEPRECATED]
Flash ad items are a legacy rich media format, often used to deliver interactive and animated advertising to users directly in their browsers. These ads are rendered by a browser plugin, and can be a useful way to capture user interest.
More recently, however, Flash has fallen out of favour and is being replaced by HTML5 Rich Media ads.
In general, ad items are assigned to an advertiser campaign, and in turn the campaign to a zone. Ad Items may be assigned to publishers directly if they related directly to that publisher (or are planned to be default/backfill ads).
Flash ads have been deprecated and can no longer be created. As Adobe removes its support of Flash, AdButler will follow.
Get a List of Flash Ad Items [DEPRECATED]
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/flash \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/flash");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/flash", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/flash")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/flash
This endpoint has been deprecated and may be disabled in the future.
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/ad-items/flash",
"data": [
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "flash_ad_item",
"self": "/v2/ad-items/flash/958422568",
"id": 958422568
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | flash_ad_item_list |
Create a Flash Ad Item [DISABLED]
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/ad-items/flash \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":442568542,"creative_url":null,"mode":"window","quality":"medium","version":"12"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/ad-items/flash");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/ad-items/flash", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/ad-items/flash")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /ad-items/flash
This endpoint has been disabled and will return a 400 error.
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | flash_ad_item_post | false | none |
» name | body | string | true | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | true | The height of the ad item. See standard banner dimensions. |
» width | body | integer | true | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | false | The flash creative identifier (ID). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative_url instead of creative in a PUT, set creative to null. |
» creative_url | body | string | false | A URL leading to a flash file (SWF). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative instead of creative_url in a PUT, set creative_url to null. |
» mode | body | string | false | The window mode property of the flash file for transparency, layering, positioning, and rendering in the browser. Accepted values are:
More information can be found here. |
» quality | body | string | false | The quality of the flash image or movie. Accepted values are:
More information can be found here. |
» version | body | string | false | The version of the flash player ranging between 5 and 100. Defaults to version 7. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "flash_ad_item",
"self": "/v2/ad-items/flash/958422568",
"id": 958422568
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | flash_ad_item_get |
Get a Single Flash Ad Item [DEPRECATED]
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/flash/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/flash/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/flash/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/flash/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/flash/{id}
This endpoint has been deprecated and may be disabled in the future.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "flash_ad_item",
"self": "/v2/ad-items/flash/958422568",
"id": 958422568
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | flash_ad_item_get |
Update a Flash Ad Item [DEPRECATED]
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/ad-items/flash/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":442568542,"creative_url":null,"mode":"window","quality":"medium","version":"12"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/ad-items/flash/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/ad-items/flash/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/ad-items/flash/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash/0"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":442568542,\"creative_url\":null,\"mode\":\"window\",\"quality\":\"medium\",\"version\":\"12\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /ad-items/flash/{id}
This endpoint has been deprecated and may be disabled in the future.
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to update. |
body | body | flash_ad_item_put | false | none |
» name | body | string | false | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | false | The height of the ad item. See standard banner dimensions. |
» width | body | integer | false | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | false | The flash creative identifier (ID). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative_url instead of creative in a PUT, set creative to null. |
» creative_url | body | string | false | A URL leading to a flash file (SWF). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative instead of creative_url in a PUT, set creative_url to null. |
» mode | body | string | false | The window mode property of the flash file for transparency, layering, positioning, and rendering in the browser. Accepted values are:
More information can be found here. |
» quality | body | string | false | The quality of the flash image or movie. Accepted values are:
More information can be found here. |
» version | body | string | false | The version of the flash player ranging between 5 and 100. Defaults to version 7. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 442568542,
"creative_url": null,
"mode": "window",
"quality": "medium",
"version": "12",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "flash_ad_item",
"self": "/v2/ad-items/flash/958422568",
"id": 958422568
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | flash_ad_item_get |
Delete a Flash Ad Item [DEPRECATED]
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/ad-items/flash/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/ad-items/flash/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/ad-items/flash/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/ad-items/flash/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /ad-items/flash/{id}
This endpoint has been deprecated and may be disabled in the future.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Get Conversion Tag for Flash Ad Item [DEPRECATED]
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/flash/0/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/flash/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/flash/0/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/flash/0/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/flash/0/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/flash/0/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/flash/{id}/conversion-tag
This endpoint has been deprecated and may be disabled in the future.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get a conversion tag for. |
Example responses
default Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
},
"url": "/v2/ad-items/flash/958422568/conversion-tag"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | flash_ad_item_conversion_tag |
Ad Items / Image
Image Ad Items (commonly known as "display ads") are an effective medium for delivering advertising messages across multiple platforms. Easy to setup and configure, you need only a creative and usually a destination URL to which users should be redirected when the ad is clicked on / interacted with.
In general, ad items are assigned to an advertiser campaign, and in turn the campaign to a zone. Ad items may be assigned to publishers directly if are they related directly to that publisher (or are planned to be default/backfill ads).
Get a List of Image Ad Items
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/image \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/image");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/image", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/image")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/image
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/ad-items/image",
"data": [
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "image_ad_item",
"self": "/v2/ad-items/image/675265899",
"id": 675265899,
"flexible_type": 0,
"is_self_serve": "true"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | image_ad_item_list |
Create an Image Ad Item
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/ad-items/image \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":null,"creative_url":"https://servedbyadbutler.com/default_banner.gif","html_alt_text":"The AdButler Logo","html_target":"_blank","flexible_type":0}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"flexible_type": 0
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/ad-items/image");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\",\"flexible_type\":0}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\",\"flexible_type\":0}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/ad-items/image", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/ad-items/image")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\",\"flexible_type\":0}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\",\"flexible_type\":0}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /ad-items/image
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"flexible_type": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | image_ad_item_post | false | none |
» name | body | string | true | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | true | The height of the ad item. See standard banner dimensions. |
» width | body | integer | true | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | false | The image creative identifier (ID). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative_url instead of creative in a PUT, set creative to null. |
» creative_url | body | string | false | A URL leading to an image file (PNG, JPEG, or GIF). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative instead of creative_url in a PUT, set creative_url to null. |
» html_alt_text | body | string | false | Textual description of the image creative intended to be used by Assistive Technologies or if the image fails to load. |
» html_target | body | string | false | The window/frame in which the destination URL should load when clicked. Leave this field as null to open in the same tab. Another common option is "_blank" for a new window or tab, but many options are available. |
» flexible_type | body | integer | false | Feature coming soon - currently unused |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "image_ad_item",
"self": "/v2/ad-items/image/675265899",
"id": 675265899,
"flexible_type": 0,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | image_ad_item_get |
Get a Single Image Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/image/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/image/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/image/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/image/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/image/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "image_ad_item",
"self": "/v2/ad-items/image/675265899",
"id": 675265899,
"flexible_type": 0,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | image_ad_item_get |
Update an Image Ad Item
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/ad-items/image/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":null,"creative_url":"https://servedbyadbutler.com/default_banner.gif","html_alt_text":"The AdButler Logo","html_target":"_blank"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/ad-items/image/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/ad-items/image/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/ad-items/image/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image/0"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":null,\"creative_url\":\"https://servedbyadbutler.com/default_banner.gif\",\"html_alt_text\":\"The AdButler Logo\",\"html_target\":\"_blank\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /ad-items/image/{id}
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to update. |
body | body | image_ad_item_put | false | none |
» name | body | string | false | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | false | The height of the ad item. See standard banner dimensions. |
» width | body | integer | false | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | false | The image creative identifier (ID). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative_url instead of creative in a PUT, set creative to null. |
» creative_url | body | string | false | A URL leading to an image file (PNG, JPEG, or GIF). Only one of creative or creative_url can be given in a POST, but one must be given. To swap an ad item to use creative instead of creative_url in a PUT, set creative_url to null. |
» html_alt_text | body | string | false | Textual description of the image creative intended to be used by Assistive Technologies or if the image fails to load. |
» html_target | body | string | false | The window/frame in which the destination URL should load when clicked. Leave this field as null to open in the same tab. Another common option is "_blank" for a new window or tab, but many options are available. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": null,
"creative_url": "https://servedbyadbutler.com/default_banner.gif",
"html_alt_text": "The AdButler Logo",
"html_target": "_blank",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "image_ad_item",
"self": "/v2/ad-items/image/675265899",
"id": 675265899,
"flexible_type": 0,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | image_ad_item_get |
Delete an Image Ad Item
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/ad-items/image/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/ad-items/image/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/ad-items/image/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/ad-items/image/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /ad-items/image/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Get Conversion Tag for Image Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/image/0/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/image/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/image/0/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/image/0/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/image/0/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/image/0/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/image/{id}/conversion-tag
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get a conversion tag for. |
Example responses
default Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
},
"url": "/v2/ad-items/image/675265899/conversion-tag"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | image_ad_item_conversion_tag |
Ad Items / Rich Media
HTML5 Rich Media ad items allow you to serve dynamic, interactive, animated advertisements through IFRAME elements in a secure environment. These IAB compatible HTML5 ads are typically uploaded as ZIP archives and include HTML, scripts, styles and media files as a self-contained package.
In general, ad items are assigned to an advertiser campaign, and in turn the campaign to a zone. Ad Items may be assigned to publishers directly if they related directly to that publisher (or are planned to be default/backfill ads). Ad Items are usually associated with advertiser campaigns, but may also be assigned to publishers directly.
Get a List of Rich Media Ad Items
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/rich-media \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/rich-media");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/rich-media", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/rich-media")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/rich-media
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/ad-items/rich-media",
"data": [
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "rich_media_ad_item",
"self": "/v2/ad-items/rich-media/745558692",
"id": 745558692,
"is_self_serve": "true"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | rich_media_ad_item_list |
Create a Rich Media Ad Item
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/ad-items/rich-media \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":552564,"expand_horizontal_direction":"right","expand_vertical_direction":"up"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/ad-items/rich-media");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/ad-items/rich-media", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/ad-items/rich-media")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /ad-items/rich-media
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | rich_media_ad_item_post | false | none |
» name | body | string | true | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | true | The height of the ad item. See standard banner dimensions. |
» width | body | integer | true | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | true | The rich media creative identifier (ID). |
» expand_horizontal_direction | body | string | false | Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none". |
» expand_vertical_direction | body | string | false | Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none". |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "rich_media_ad_item",
"self": "/v2/ad-items/rich-media/745558692",
"id": 745558692,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | rich_media_ad_item_get |
Get a Single Rich Media Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/rich-media/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/rich-media/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/rich-media/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/rich-media/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/rich-media/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get. |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "rich_media_ad_item",
"self": "/v2/ad-items/rich-media/745558692",
"id": 745558692,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | rich_media_ad_item_get |
Update a Rich Media Ad Item
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/ad-items/rich-media/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Example Ad Item","height":400,"width":650,"tracking_pixel":"https://url","location":"https://adbutler.com","html_content_below":"<img />","creative":552564,"expand_horizontal_direction":"right","expand_vertical_direction":"up"}'
var data = JSON.stringify({
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/ad-items/rich-media/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/ad-items/rich-media/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/ad-items/rich-media/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media/0"
payload := strings.NewReader("{\"name\":\"Example Ad Item\",\"height\":400,\"width\":650,\"tracking_pixel\":\"https://url\",\"location\":\"https://adbutler.com\",\"html_content_below\":\"<img />\",\"creative\":552564,\"expand_horizontal_direction\":\"right\",\"expand_vertical_direction\":\"up\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /ad-items/rich-media/{id}
Body parameter
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to update. |
body | body | rich_media_ad_item_put | false | none |
» name | body | string | false | A descriptive name of the ad item. We recommend using a naming convention that is consistent, relevant, and clear. |
» height | body | integer | false | The height of the ad item. See standard banner dimensions. |
» width | body | integer | false | The width of the ad item. See standard banner dimensions. |
» tracking_pixel | body | string | false | An optional third party tracking pixel served with the ad for monitoring impressions. A null value indicates tracking pixel is not being used. |
» location | body | string | false | The destination URL where the user will be redirected to when they click on the ad item. A null value denotes no redirection. |
» html_content_below | body | string | false | The HTML content that will appear below the ad item. |
» creative | body | string | false | The rich media creative identifier (ID). |
» expand_horizontal_direction | body | string | false | Whether to allow the rich media ad item to expand in the horizontal direction. The value can be "none", "left", or "right". Defaults to "none". |
» expand_vertical_direction | body | string | false | Whether to allow the rich media ad item to expand in the vertical direction. The value can be "none", "up", or "down". Defaults to "none". |
Example responses
default Response
{
"name": "Example Ad Item",
"height": 400,
"width": 650,
"tracking_pixel": "https://url",
"location": "https://adbutler.com",
"html_content_below": "<img />",
"creative": 552564,
"expand_horizontal_direction": "right",
"expand_vertical_direction": "up",
"created_date": "2019-04-26 14:55:31",
"last_modified": "2019-04-26 14:55:39",
"object": "rich_media_ad_item",
"self": "/v2/ad-items/rich-media/745558692",
"id": 745558692,
"is_self_serve": "true"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | rich_media_ad_item_get |
Delete a Rich Media Ad Item
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/ad-items/rich-media/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/ad-items/rich-media/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/ad-items/rich-media/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/ad-items/rich-media/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /ad-items/rich-media/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Get Conversion Tag for Rich Media Ad Item
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/ad-items/rich-media/0/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/ad-items/rich-media/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/ad-items/rich-media/0/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/ad-items/rich-media/0/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/ad-items/rich-media/0/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/ad-items/rich-media/0/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /ad-items/rich-media/{id}/conversion-tag
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the ad item you'd like to get a conversion tag for. |
Example responses
default Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
},
"url": "/v2/ad-items/rich-media/745558692/conversion-tag"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | rich_media_ad_item_conversion_tag |
Advertisers
An advertiser is an individual or a company paying for one or more advertisements to be served. You and your managers (if permitted) can create advertiser accounts. They may also copy conversion tags and optionally be able to submit new advertisements for review.
Get a List of Advertisers
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers
Returns a list of advertisers. If no advertisers were found, the data object will be empty.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/advertisers",
"data": [
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"self": "/v2/advertisers/5195",
"parent": "admin"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | advertiser_list |
Create an Advertiser
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/advertisers \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"can_change_password":true,"can_add_ad_items":true,"email":"advertiser@adbutler.com","name":"Example Advertiser","password":"**********"}'
var data = JSON.stringify({
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"password": "**********"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/advertisers");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/advertisers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/advertisers")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers"
payload := strings.NewReader("{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /advertisers
Body parameter
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"password": "**********"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | advertiser_post | false | none |
» can_change_password | body | boolean | false | Whether to allow this advertiser to change their own password. |
» can_add_ad_items | body | boolean | false | Whether to allow this advertiser to submit advertisements for scheduling in the zones you own. |
body | string | false | A valid email owned by the advertiser that allows them to log in to the advertiser portal. When set to the default (nobody@adbutler.com), the advertiser will not have access to the advertiser portal. | |
» name | body | string | true | Name of the advertiser. |
» password | body | string | false | The password of the optional user account tied to this advertiser. The given password must be 8 or more characters and contain at least one uppercase character, lowercase character, and number. Password managers and special characters are recommended. If left blank on advertiser creation, a random password will be generated. This field will never be returned in any responses. |
Example responses
default Response
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"self": "/v2/advertisers/5195",
"parent": "admin"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | advertiser_get |
Get a List of Archived Advertisers
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers/archived \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers/archived");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/archived")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers/archived", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers/archived")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/archived"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers/archived
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/advertisers/archived",
"data": [
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"archived": true,
"archived_on": "2019-01-25 11:00:00",
"self": "/v2/advertisers/archived/5195"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | archived_advertiser_list |
Get a Single Archived Advertiser
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers/archived/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers/archived/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/archived/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers/archived/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers/archived/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/archived/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the archived resource. |
Example responses
default Response
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"archived": true,
"archived_on": "2019-01-25 11:00:00",
"self": "/v2/advertisers/archived/5195"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | archived_advertiser_get |
Unarchive an Advertiser
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers/archived/0/unarchive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers/archived/0/unarchive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/archived/0/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers/archived/0/unarchive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers/archived/0/unarchive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/archived/0/unarchive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers/archived/{id}/unarchive
Unarchives the resource and all resources that were previously archived with the resource.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the advertiser you'd like to unarchive |
include_campaign_assignments | path | boolean | false | Whether or not to include related campaign assignments when unarchiving the resource. If an unarchived assignment references an invalid resource, the campaign assignment will not be unarchived and information about the invalid resource and references will be returned. The advertiser resource will still be unarchived. |
include_placements | path | boolean | false | Whether or not to include related placements when unarchiving the resource. If an unarchived placement references an invalid resource, the placement will not be unarchived and information about the invalid resource and references will be returned. The advertiser resource will still be unarchived. |
Example responses
default Response
{
"object": "unarchive",
"url": "/v2/advertisers/archived/5049/unarchive",
"data": {
"unarchived_resources": [
{
"object": "advertiser",
"id": 5049
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | unarchived_advertiser |
Get a Single Advertiser
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the advertiser you'd like to get. |
Example responses
default Response
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"self": "/v2/advertisers/5195",
"parent": "admin"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | advertiser_get |
Update an Advertiser
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/advertisers/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"can_change_password":true,"can_add_ad_items":true,"email":"advertiser@adbutler.com","name":"Example Advertiser","password":"**********"}'
var data = JSON.stringify({
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"password": "**********"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/advertisers/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/advertisers/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/advertisers/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/0"
payload := strings.NewReader("{\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\",\"password\":\"**********\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /advertisers/{id}
Body parameter
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"password": "**********"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the advertiser you'd like to update. |
body | body | advertiser_put | false | none |
» can_change_password | body | boolean | false | Whether to allow this advertiser to change their own password. |
» can_add_ad_items | body | boolean | false | Whether to allow this advertiser to submit advertisements for scheduling in the zones you own. |
body | string | false | A valid email owned by the advertiser that allows them to log in to the advertiser portal. When set to the default (nobody@adbutler.com), the advertiser will not have access to the advertiser portal. | |
» name | body | string | false | Name of the advertiser. |
» password | body | string | false | The password of the optional user account tied to this advertiser. The given password must be 8 or more characters and contain at least one uppercase character, lowercase character, and number. Password managers and special characters are recommended. If left blank on advertiser creation, a random password will be generated. This field will never be returned in any responses. |
Example responses
default Response
{
"can_change_password": true,
"can_add_ad_items": true,
"email": "advertiser@adbutler.com",
"name": "Example Advertiser",
"object": "advertiser",
"id": 5195,
"has_password": true,
"self": "/v2/advertisers/5195",
"parent": "admin"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | advertiser_get |
Delete an Advertiser
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/advertisers/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/advertisers/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/advertisers/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/advertisers/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /advertisers/{id}
Permanently deletes an advertiser. This operation cannot be undone so be very sure when deleting one. Successful deletion immediately stops serving any ads belonging to this advertiser and advertiser login will be disabled.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the advertiser you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Archive an Advertiser
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/advertisers/0/archive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/advertisers/0/archive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/advertisers/0/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/advertisers/0/archive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/advertisers/0/archive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/advertisers/0/archive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /advertisers/{id}/archive
Archives the resource and all direct descendents of this resource. Archived resources will be treated the same as deleted resources but can be restored through unarchiving.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the advertiser you'd like to archive. |
Example responses
default Response
{
"object": "archive",
"url": "/v2/advertisers/5049/archive",
"data": {
"archived_resources": [
{
"object": "advertiser",
"id": 5049
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | archived_advertiser |
Bidders
To run a header bidding auction with AdButler, you need to create a Bidder. A Bidder will contain all of the necessary information required to insert itself into a Prebid auction, as well as a name to help you identify it.
Get a List of Bidders
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/bidders \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/bidders");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/bidders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/bidders", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/bidders")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/bidders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /bidders
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/bidders",
"data": [
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
},
"object": "bidder",
"id": 6899,
"self": "/v2/bidders/6899",
"created_date": "2019-03-27 18:43:52"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | bidder_list |
Create a Bidder
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/bidders \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"bidder_code":"adbutler","name":"AdButler Bidder","parameters":{"accountID":"123456789","keyword":"cats,kittens","maxCPM":"3.0","minCPM":"1.0","zoneID":"5658"}}'
var data = JSON.stringify({
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/bidders");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/bidders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/bidders", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/bidders")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/bidders"
payload := strings.NewReader("{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /bidders
Body parameter
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | bidder_post | false | none |
» bidder_code | body | string | true | The unique token of the bidding parter that this bidder will represent. See the up-to-date list of bidder codes. |
» name | body | string | true | A descriptive name of the bidder. |
» parameters | body | object | true | The custom parameters of the chosen bidding partner. We have included AdButler's parameters as an example, but other bidders will ask for different parameters. Find required bidder parameters here. |
»» accountID | body | string | false | One of AdButler's bidder parameters. Required for an AdButler bidder. |
»» keyword | body | string | false | One of AdButler's bidder parameters. |
»» maxCPM | body | string | false | One of AdButler's bidder parameters. |
»» minCPM | body | string | false | One of AdButler's bidder parameters. |
»» zoneID | body | string | false | One of AdButler's bidder parameters. Required for an AdButler bidder. |
Example responses
default Response
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
},
"object": "bidder",
"id": 6899,
"self": "/v2/bidders/6899",
"created_date": "2019-03-27 18:43:52"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | bidder_get |
Get a Single Bidder
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/bidders/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/bidders/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/bidders/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/bidders/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/bidders/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/bidders/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /bidders/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the bidder you'd like to get. |
Example responses
default Response
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
},
"object": "bidder",
"id": 6899,
"self": "/v2/bidders/6899",
"created_date": "2019-03-27 18:43:52"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | bidder_get |
Update a Bidder
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/bidders/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"bidder_code":"adbutler","name":"AdButler Bidder","parameters":{"accountID":"123456789","keyword":"cats,kittens","maxCPM":"3.0","minCPM":"1.0","zoneID":"5658"}}'
var data = JSON.stringify({
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/bidders/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/bidders/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/bidders/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/bidders/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/bidders/0"
payload := strings.NewReader("{\"bidder_code\":\"adbutler\",\"name\":\"AdButler Bidder\",\"parameters\":{\"accountID\":\"123456789\",\"keyword\":\"cats,kittens\",\"maxCPM\":\"3.0\",\"minCPM\":\"1.0\",\"zoneID\":\"5658\"}}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /bidders/{id}
Body parameter
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the bidder you'd like to update. |
body | body | bidder_put | false | none |
» bidder_code | body | string | false | The unique token of the bidding parter that this bidder will represent. See the up-to-date list of bidder codes. |
» name | body | string | false | A descriptive name of the bidder. |
» parameters | body | object | false | The custom parameters of the chosen bidding partner. We have included AdButler's parameters as an example, but other bidders will ask for different parameters. Find required bidder parameters here. |
»» accountID | body | string | false | One of AdButler's bidder parameters. Required for an AdButler bidder. |
»» keyword | body | string | false | One of AdButler's bidder parameters. |
»» maxCPM | body | string | false | One of AdButler's bidder parameters. |
»» minCPM | body | string | false | One of AdButler's bidder parameters. |
»» zoneID | body | string | false | One of AdButler's bidder parameters. Required for an AdButler bidder. |
Example responses
default Response
{
"bidder_code": "adbutler",
"name": "AdButler Bidder",
"parameters": {
"accountID": "123456789",
"keyword": "cats,kittens",
"maxCPM": "3.0",
"minCPM": "1.0",
"zoneID": "5658"
},
"object": "bidder",
"id": 6899,
"self": "/v2/bidders/6899",
"created_date": "2019-03-27 18:43:52"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | bidder_get |
Delete a Bidder
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/bidders/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/bidders/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/bidders/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/bidders/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/bidders/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/bidders/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /bidders/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the bidder you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Campaign Assignments
A campaign assignment represents the relationship between an ad item and a campaign.
Get a list of Campaign Assignments
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaign-assignments \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaign-assignments");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaign-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaign-assignments", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaign-assignments")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaign-assignments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaign-assignments
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"data": [
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000,
"object": "campaign_assignment",
"id": 8247,
"self": "/v2/campaign-assignments/8247"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | campaign_assignment_list |
Create a Campaign Assignment
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/campaign-assignments \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"active":true,"advertisement":{"id":92213512,"type":"image_ad_item"},"campaign":{"id":442135,"type":"standard_campaign"},"weight":0,"data_key_target":10000}'
var data = JSON.stringify({
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/campaign-assignments");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaign-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/campaign-assignments", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/campaign-assignments")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaign-assignments"
payload := strings.NewReader("{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /campaign-assignments
Body parameter
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | campaign_assignment_post | false | none |
» active | body | boolean | false | The status of ad serving, whether it is being served int he given zone or not. |
» advertisement | body | object | true | An object containing the identifier and type of advertisement (image, flash, rich media or custom HTML. |
»» id | body | integer | true | The advertisement identifier (ID) |
»» type | body | string | true | The type of advertisement. Allowable values include: "image_ad_item", "flash_ad_item", "rich_media_ad_item", "custom_html_ad_item", and "text_ad". |
» campaign | body | object | true | An object containing ad item or text campaign identifier and type. |
»» id | body | integer | true | The campaign identifier (ID) |
»» type | body | string | true | The type of campaign. Allowable values are "standard_campaign" or "text_campaign" |
» weight | body | integer | false | A number used to compute the probability of serving a particular ad. |
» data_key_target | body | integer | false | The Data Key Target identifier (ID). |
Example responses
default Response
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000,
"object": "campaign_assignment",
"id": 8247,
"self": "/v2/campaign-assignments/8247"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | campaign_assignment_get |
Get a Single Campaign Assignment
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaign-assignments/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaign-assignments/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaign-assignments/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaign-assignments/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaign-assignments/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaign-assignments/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaign-assignments/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the campaign assignment you'd like to get. |
Example responses
default Response
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000,
"object": "campaign_assignment",
"id": 8247,
"self": "/v2/campaign-assignments/8247"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | campaign_assignment_get |
Update a Campaign Assignment
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/campaign-assignments/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"active":true,"advertisement":{"id":92213512,"type":"image_ad_item"},"campaign":{"id":442135,"type":"standard_campaign"},"weight":0,"data_key_target":10000}'
var data = JSON.stringify({
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/campaign-assignments/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaign-assignments/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/campaign-assignments/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/campaign-assignments/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaign-assignments/0"
payload := strings.NewReader("{\"active\":true,\"advertisement\":{\"id\":92213512,\"type\":\"image_ad_item\"},\"campaign\":{\"id\":442135,\"type\":\"standard_campaign\"},\"weight\":0,\"data_key_target\":10000}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /campaign-assignments/{id}
Body parameter
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the campaign assignmnet you'd like to update. |
body | body | campaign_assignment_put | false | none |
» active | body | boolean | false | The status of ad serving, whether it is being served int he given zone or not. |
» advertisement | body | object | false | An object containing the identifier and type of advertisement (image, flash, rich media or custom HTML. |
»» id | body | integer | true | The advertisement identifier (ID) |
»» type | body | string | true | The type of advertisement. Allowable values include: "image_ad_item", "flash_ad_item", "rich_media_ad_item", "custom_html_ad_item", and "text_ad". |
» campaign | body | object | false | An object containing ad item or text campaign identifier and type. |
»» id | body | integer | true | The campaign identifier (ID) |
»» type | body | string | true | The type of campaign. Allowable values are "standard_campaign" or "text_campaign" |
» weight | body | integer | false | A number used to compute the probability of serving a particular ad. |
» data_key_target | body | integer | false | The Data Key Target identifier (ID). |
Example responses
default Response
{
"active": true,
"advertisement": {
"id": 92213512,
"type": "image_ad_item"
},
"campaign": {
"id": 442135,
"type": "standard_campaign"
},
"weight": 0,
"data_key_target": 10000,
"object": "campaign_assignment",
"id": 8247,
"self": "/v2/campaign-assignments/8247"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | campaign_assignment_get |
Delete a Campaign Assignment
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/campaign-assignments/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/campaign-assignments/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaign-assignments/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/campaign-assignments/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaign-assignments/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaign-assignments/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /campaign-assignments/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the campaign assignment you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Campaigns (All)
Get a List of All Campaigns
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns",
"data": [
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | campaign_list |
Campaigns / Standard
Standard campaigns are an effective way for you to organize your ads under an Advertiser. Campaigns can be scheduled to serve in zones of your choice, enabling you to easily collect grouped statistics and determine payouts for advertisers. As of July 2019, campaigns no longer have size restrictions.
Get a List of Standard Campaigns
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns/standard",
"data": [
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_list |
Create a Standard Campaign
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/campaigns/standard \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"advertiser":633215,"name":"Example Standard Campaign","flexible_type":0,"roadblock_tags":null}'
var data = JSON.stringify({
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/campaigns/standard");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/campaigns/standard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/campaigns/standard")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard"
payload := strings.NewReader("{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /campaigns/standard
Body parameter
{
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | standard_campaign | false | none |
» advertiser | body | integer | false | The advertiser identifier (ID). |
» name | body | string | true | The name of the campaign. |
» flexible_type | body | integer | false | The flexible type ID. Only flexible ad items and campaigns can be assigned to flexible zones, and the type must match. (Feature coming soon - currently unused) |
» roadblock_tags | body | string | false | The tag to link this campaign to a roadblock. |
Example responses
200 Response
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_get |
Get a Standard Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/ \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/{id}
Example responses
200 Response
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Update a Standard Campaign
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/campaigns/standard/1234 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"advertiser":633215,"name":"Example Standard Campaign","flexible_type":0,"roadblock_tags":null}'
var data = JSON.stringify({
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/campaigns/standard/1234");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/campaigns/standard/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/campaigns/standard/1234")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/1234"
payload := strings.NewReader("{\"advertiser\":633215,\"name\":\"Example Standard Campaign\",\"flexible_type\":0,\"roadblock_tags\":null}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /campaigns/standard/{id}
Body parameter
{
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
body | body | standard_campaign | false | none |
» advertiser | body | integer | false | The advertiser identifier (ID). |
» name | body | string | true | The name of the campaign. |
» flexible_type | body | integer | false | The flexible type ID. Only flexible ad items and campaigns can be assigned to flexible zones, and the type must match. (Feature coming soon - currently unused) |
» roadblock_tags | body | string | false | The tag to link this campaign to a roadblock. |
Example responses
200 Response
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete a Standard Campaign
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/campaigns/standard/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/campaigns/standard/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/campaigns/standard/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/standard/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /campaigns/standard/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Archive a Standard Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/1234/archive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/1234/archive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/1234/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/1234/archive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/1234/archive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/1234/archive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/{id}/archive
Archives the resource and all direct descendents of this resource. Archived resources will be treated the same as deleted resources but can be restored through unarchiving.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "archive",
"url": "/v2/campaigns/standard/1234/archive",
"data": {
"archived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_archive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Retrieve Standard Campaign Conversion Tag
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/1234/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/1234/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/1234/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/1234/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/1234/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/1234/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/{id}/conversion-tag
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | conversion_tag |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Campaigns / Standard / Archived
Get a List of Archived Standard Campaigns
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/archived \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/archived");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/archived")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/archived", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/archived")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/archived"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/archived
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns/standard/archived",
"data": [
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/archived/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null,
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_standard_campaign_list |
Get an Archived Standard Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/archived/1234"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "standard_campaign",
"self": "/v2/campaigns/standard/archived/1234",
"id": 1234,
"advertiser": 633215,
"name": "Example Standard Campaign",
"flexible_type": 0,
"roadblock_tags": null,
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_standard_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete an Archived Standard Campaign
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/campaigns/standard/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/campaigns/standard/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/campaigns/standard/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/standard/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/archived/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /campaigns/standard/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Unarchive a Standard Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/standard/archived/1234/unarchive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/standard/archived/1234/unarchive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/standard/archived/1234/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/standard/archived/1234/unarchive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/archived/1234/unarchive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/standard/archived/1234/unarchive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/standard/archived/{id}/unarchive
Unarchives the resource and all resources that were previously archived with the resource.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
include_campaign_assignments | path | boolean | false | Whether or not to include related campaign assignments when unarchiving the resource. If an unarchived assignment references an invalid resource, the campaign assignment will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
include_placements | path | boolean | false | Whether or not to include related placements when unarchiving the resource. If an unarchived placement references an invalid resource, the placement will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
pause_placements | path | boolean | false | Whether or not to pause the placements being unarchived. |
Example responses
200 Response
{
"object": "unarchive",
"url": "/v2/campaigns/standard/archived/1234/unarchive",
"data": {
"unarchived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | standard_campaign_unarchive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Campaigns / Text
Text campaigns are an effective way for you to organize your text ads under an Advertiser. Campaigns can be scheduled to serve in zones of your choice, enabling you to easily collect grouped statistics and determine payouts for Advertisers.
Get a List of Text Campaigns
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns/text",
"data": [
{
"object": "text_campaign",
"self": "/v2/campaigns/text/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_list |
Create a Text Campaign
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/campaigns/text \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"advertiser":755124,"name":"Example Standard Campaign"}'
var data = JSON.stringify({
"advertiser": 755124,
"name": "Example Standard Campaign"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/campaigns/text");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/campaigns/text", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/campaigns/text")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text"
payload := strings.NewReader("{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /campaigns/text
Body parameter
{
"advertiser": 755124,
"name": "Example Standard Campaign"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | text_campaign | false | none |
» advertiser | body | integer | false | The advertiser identifier (ID). |
» name | body | string | true | The name of the campaign. |
Example responses
200 Response
{
"object": "text_campaign",
"self": "/v2/campaigns/text/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_get |
Get a Text Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/ \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/{id}
Example responses
200 Response
{
"object": "text_campaign",
"self": "/v2/campaigns/text/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Update a Text Campaign
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/campaigns/text/1234 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"advertiser":755124,"name":"Example Standard Campaign"}'
var data = JSON.stringify({
"advertiser": 755124,
"name": "Example Standard Campaign"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/campaigns/text/1234");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/campaigns/text/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/campaigns/text/1234")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/1234"
payload := strings.NewReader("{\"advertiser\":755124,\"name\":\"Example Standard Campaign\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /campaigns/text/{id}
Body parameter
{
"advertiser": 755124,
"name": "Example Standard Campaign"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
body | body | text_campaign | false | none |
» advertiser | body | integer | false | The advertiser identifier (ID). |
» name | body | string | true | The name of the campaign. |
Example responses
200 Response
{
"object": "text_campaign",
"self": "/v2/campaigns/text/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete a Text Campaign
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/campaigns/text/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/campaigns/text/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/campaigns/text/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/text/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /campaigns/text/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Archive a Text Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/1234/archive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/1234/archive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/1234/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/1234/archive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/1234/archive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/1234/archive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/{id}/archive
Archives the resource and all direct descendents of this resource. Archived resources will be treated the same as deleted resources but can be restored through unarchiving.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "archive",
"url": "/v2/campaigns/text/1234/archive",
"data": {
"archived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_archive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Retrieve Text Campaign Conversion Tag
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/1234/conversion-tag \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/1234/conversion-tag");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/1234/conversion-tag")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/1234/conversion-tag", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/1234/conversion-tag")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/1234/conversion-tag"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/{id}/conversion-tag
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "conv_tag",
"data": {
"src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
"html": "<img />"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | conversion_tag |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Campaigns / Text / Archived
Get a List of Archived Text Campaigns
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/archived \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/archived");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/archived")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/archived", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/archived")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/archived"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/archived
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/campaigns/text/archived",
"data": [
{
"object": "text_campaign",
"self": "/v2/campaigns/text/archived/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign",
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_text_campaign_list |
Get an Archived Text Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/archived/1234"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "text_campaign",
"self": "/v2/campaigns/text/archived/1234",
"id": 1234,
"advertiser": 755124,
"name": "Example Standard Campaign",
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_text_campaign_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete an Archived Text Campaign
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/campaigns/text/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/campaigns/text/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/campaigns/text/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/text/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/archived/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /campaigns/text/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Unarchive a Text Campaign
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/campaigns/text/archived/1234/unarchive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/campaigns/text/archived/1234/unarchive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/campaigns/text/archived/1234/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/campaigns/text/archived/1234/unarchive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/archived/1234/unarchive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/campaigns/text/archived/1234/unarchive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /campaigns/text/archived/{id}/unarchive
Unarchives the resource and all resources that were previously archived with the resource.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
include_campaign_assignments | path | boolean | false | Whether or not to include related campaign assignments when unarchiving the resource. If an unarchived assignment references an invalid resource, the campaign assignment will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
include_placements | path | boolean | false | Whether or not to include related placements when unarchiving the resource. If an unarchived placement references an invalid resource, the placement will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
pause_placements | path | boolean | false | Whether or not to pause the placements being unarchived. |
Example responses
200 Response
{
"object": "unarchive",
"url": "/v2/campaigns/text/archived/1234/unarchive",
"data": {
"unarchived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | text_campaign_unarchive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Channel Zone Assignments
A channel zone assignment represents the relationship between a channel and a zone.
Get a List of Channel Zone Assignments
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channel-zone-assignments \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channel-zone-assignments");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channel-zone-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channel-zone-assignments", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channel-zone-assignments")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channel-zone-assignments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channel-zone-assignments
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/channel-zone-assignments",
"data": [
{
"channel": 66245,
"zone": {
"id": 559124,
"type": "standard_zone"
},
"object": "channel_zone_assignment",
"id": 442365,
"self": "/v2/channel-zone-assignments/442365"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | channel_zone_assignment_list |
Create a Channel Zone Assignment
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/channel-zone-assignments \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"channel":66245,"zone":{"id":559124,"type":"standard_zone"}}'
var data = JSON.stringify({
"channel": 66245,
"zone": {
"id": 559124,
"type": "standard_zone"
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/channel-zone-assignments");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channel-zone-assignments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"channel\":66245,\"zone\":{\"id\":559124,\"type\":\"standard_zone\"}}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"channel\":66245,\"zone\":{\"id\":559124,\"type\":\"standard_zone\"}}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/channel-zone-assignments", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/channel-zone-assignments")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"channel\":66245,\"zone\":{\"id\":559124,\"type\":\"standard_zone\"}}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channel-zone-assignments"
payload := strings.NewReader("{\"channel\":66245,\"zone\":{\"id\":559124,\"type\":\"standard_zone\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /channel-zone-assignments
Body parameter
{
"channel": 66245,
"zone": {
"id": 559124,
"type": "standard_zone"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | channel_zone_assignment_post | false | none |
» channel | body | integer | false | The channel identifier (ID) to which you want to assign the given zones. |
» zone | body | object | false | An object containing standard, email or text zone identifier (ID) and type. |
»» id | body | integer | false | The identifier (ID) of the zone. |
»» type | body | string | false | The type of zone. Accepted values are "standard_zone", "text_zone", and "email_zone". |
Example responses
default Response
{
"channel": 66245,
"zone": {
"id": 559124,
"type": "standard_zone"
},
"object": "channel_zone_assignment",
"id": 442365,
"self": "/v2/channel-zone-assignments/442365"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | channel_zone_assignment_get |
Get a Single Channel Zone Assignment
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channel-zone-assignments/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channel-zone-assignments/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channel-zone-assignments/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channel-zone-assignments/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channel-zone-assignments/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channel-zone-assignments/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channel-zone-assignments/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the channel zone assignment you'd like to get. |
Example responses
default Response
{
"channel": 66245,
"zone": {
"id": 559124,
"type": "standard_zone"
},
"object": "channel_zone_assignment",
"id": 442365,
"self": "/v2/channel-zone-assignments/442365"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | channel_zone_assignment_get |
Delete a Channel Zone Assignment
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/channel-zone-assignments/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/channel-zone-assignments/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channel-zone-assignments/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/channel-zone-assignments/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/channel-zone-assignments/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channel-zone-assignments/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /channel-zone-assignments/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the channel zone assignment you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Channels
Channels allow advertisers to easily assign their campaigns to multiple zones usually having a particular focus (e.g. sports) and perhaps owned by different publishers. This is desirable when a campaign with the same assignment settings is to be assigned to a large number of zones. To assign a zone to a channel, use the /channel-zone-assignments endpoint.
Get a List of Channels
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/channels",
"data": [
{
"object": "channel",
"self": "/v2/channels/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_list |
Create a Channel
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/channels \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Low-Priority Channel","priority":"house","zones":[{"id":5526,"type":"standard_zone"},{"id":5387,"type":"standard_zone"}]}'
var data = JSON.stringify({
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/channels");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/channels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/channels")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels"
payload := strings.NewReader("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /channels
Body parameter
{
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | channel | false | none |
» name | body | string | true | A descriptive name of the channel. |
» priority | body | string | false | The serving priority of the channel. Possible values are, in descending order: "sponsorship", "standard", "network", "bulk", and "house". If left blank, the priority is defaulted to "standard". Read more about priority here. |
» zones | body | [channel_zone] | false | A list of zones assigned to the channel. Null if empty. |
»» id | body | integer | false | The identifier (ID) of the zone. |
»» type | body | string | false | The zone type. e.g. standard, text, etc. |
Example responses
200 Response
{
"object": "channel",
"self": "/v2/channels/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_get |
Get a Single Channel
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/1234"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "channel",
"self": "/v2/channels/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Update a Channel
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/channels/1234 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Low-Priority Channel","priority":"house","zones":[{"id":5526,"type":"standard_zone"},{"id":5387,"type":"standard_zone"}]}'
var data = JSON.stringify({
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/channels/1234");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/channels/1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/channels/1234")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/1234"
payload := strings.NewReader("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\",\"zones\":[{\"id\":5526,\"type\":\"standard_zone\"},{\"id\":5387,\"type\":\"standard_zone\"}]}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /channels/{id}
Body parameter
{
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
body | body | channel | false | none |
» name | body | string | true | A descriptive name of the channel. |
» priority | body | string | false | The serving priority of the channel. Possible values are, in descending order: "sponsorship", "standard", "network", "bulk", and "house". If left blank, the priority is defaulted to "standard". Read more about priority here. |
» zones | body | [channel_zone] | false | A list of zones assigned to the channel. Null if empty. |
»» id | body | integer | false | The identifier (ID) of the zone. |
»» type | body | string | false | The zone type. e.g. standard, text, etc. |
Example responses
200 Response
{
"object": "channel",
"self": "/v2/channels/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete a Channel
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/channels/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/channels/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/channels/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/channels/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /channels/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Archive a Channel
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels/1234/archive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels/1234/archive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/1234/archive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels/1234/archive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/1234/archive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/1234/archive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels/{id}/archive
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "archive",
"url": "/v2/channels/1234/archive",
"data": {
"archived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_archive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Channels / Archived
Get a List of Archived Channels
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels/archived \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels/archived");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/archived")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels/archived", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/archived")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/archived"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels/archived
Example responses
200 Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/channels/archived",
"data": [
{
"object": "channel",
"self": "/v2/channels/archived/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
],
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_channel_list |
Get an Archived Channel
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/archived/1234"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"object": "channel",
"self": "/v2/channels/archived/1234",
"id": 1234,
"name": "Low-Priority Channel",
"priority": "house",
"zones": [
{
"id": 5526,
"type": "standard_zone"
},
{
"id": 5387,
"type": "standard_zone"
}
],
"archived_on": "2019-07-30T12:30:00+00:00",
"archived": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | archived_channel_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Delete an Archived Channel
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/channels/archived/1234 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/channels/archived/1234");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/archived/1234")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/channels/archived/1234", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/channels/archived/1234")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/archived/1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /channels/archived/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
Example responses
200 Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | deleted |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Unarchive an Archived Channel
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/channels/archived/1234/unarchive \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/channels/archived/1234/unarchive");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/channels/archived/1234/unarchive")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/channels/archived/1234/unarchive", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/archived/1234/unarchive")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/channels/archived/1234/unarchive"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /channels/archived/{id}/unarchive
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the resource |
include_zone_assignments | path | boolean | false | Whether or not to include related zone assignments when unarchiving the resource. If an unarchived assignment references an invalid resource, the zone assignment will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
include_placements | path | boolean | false | Whether or not to include related placements when unarchiving the resource. If an unarchived placement references an invalid resource, the placement will not be unarchived and information about the invalid resource and references will be returned. The parent resource will still be unarchived. |
pause_placements | path | boolean | false | Whether or not to pause the placements being unarchived. |
Example responses
200 Response
{
"object": "unarchive",
"url": "/v2/channels/archived/1234/unarchive",
"data": {
"unarchived_resources": [
{
"object": "string",
"id": 1234
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | channel_unarchive_get |
404 | Not Found | Resource not found | error_resource_does_not_exist |
Creatives (All)
Get a List of All Creatives
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/creatives/image",
"data": [
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_list |
Creatives / Image
The image file that makes up an advertisement is known as the image creative. You can create a new image creative, retrieve one or more image creatives, update an existing image creative, or delete the image creative.
Get a List of Image Creatives
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/image \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/image");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/image", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/image")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/image
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/creatives/image",
"data": [
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_list |
Create an Image Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/image \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/image.png \
--form 'attributes={"description":"This is a description", "group":55, "name":"This is a name."}'
var data = new FormData();
data.append("file", "@/path/to/image.png");
data.append("attributes", "{\"description\":\"This is a description\", \"group\":55, \"name\":\"This is a name.\"}");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/image");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/image", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/image")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/image
Body parameter
file: '@/path/to/image.png'
attributes: '{"description":"This is a description", "group":55, "name":"This is a name."}'
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | creative_image_post | false | none |
» file | body | string | true | The absolute or relative path to the image (JPEG, PNG, or GIF) file. |
» attributes | body | string | false | none |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_get |
Get a Single Image Creative
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/image/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/image/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/image/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/image/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/image/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to get. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_get |
Update an Image Creative
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/creatives/image/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"description":"","group":87,"name":"Demo Creative"}'
var data = JSON.stringify({
"description": "",
"group": 87,
"name": "Demo Creative"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/creatives/image/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/creatives/image/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/creatives/image/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image/0"
payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /creatives/image/{id}
Body parameter
{
"description": "",
"group": 87,
"name": "Demo Creative"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to update. |
body | body | creative_image_put | false | none |
» description | body | integer | false | A short description of the creative. |
» group | body | integer | false | The media group identifier (ID). |
» name | body | string | false | A descriptive name of the creative. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_get |
Delete an Image Creative
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/creatives/image/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/creatives/image/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/creatives/image/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/creatives/image/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /creatives/image/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Replace the File on an Image Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/image//replace-file \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/image.png
var data = new FormData();
data.append("file", "@/path/to/image.png");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/image//replace-file");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/image//replace-file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/image//replace-file", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/image//replace-file")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/image//replace-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/image.png")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/image/{id}/replace-file
Body parameter
file: '@/path/to/image.png'
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | creative_image_file_replace | false | none |
» file | body | string | true | The absolute or relative path to the image (JPEG, PNG, or GIF) file. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "image_creative",
"id": 115260,
"self": "/v2/creatives/image/115260",
"file_name": "creative.png",
"mime_type": "image/png"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_image_get |
Creatives / Rich Media
The zip archive of HTML, CSS and JavaScript files that makes up an advertisement is known as the rich media creative. You can create a new rich media creative, retrieve one or more rich media creatives, update an existing rich media creative, or delete the rich media creative.
Get a List of Rich Media Creatives
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/rich-media \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/rich-media");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/rich-media", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/rich-media")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/rich-media
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/creative/rich-media",
"data": [
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"object": "rich_media_creative",
"id": 115263,
"self": "/v2/creatives/video/115263",
"file_name": "creative.zip",
"mime_type": "application/zip",
"has_click_macro": true
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_rich_media_list |
Create a Rich Media Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/rich-media \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/archive.zip \
--form 'attributes={"description":"This is a description", "group":55, "name":"This is a name.", "index_file_path":"path/to/index.html"}'
var data = new FormData();
data.append("file", "@/path/to/archive.zip");
data.append("attributes", "{\"description\":\"This is a description\", \"group\":55, \"name\":\"This is a name.\", \"index_file_path\":\"path/to/index.html\"}");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/rich-media");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/archive.zip"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/archive.zip"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/rich-media", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/rich-media")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/archive.zip")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/archive.zip")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/rich-media
Body parameter
file: '@/path/to/archive.zip'
attributes: >-
{"description":"This is a description", "group":55, "name":"This is a name.",
"index_file_path":"path/to/index.html"}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | creative_rich_media_post | false | none |
» file | body | string | true | The absolute or relative path to the rich media (ZIP) file. |
» attributes | body | string | false | A JSON encoded string containing the 'group' parameter and 0 or more of the parameters 'description','name', or 'index_file_path'. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"object": "rich_media_creative",
"id": 115263,
"self": "/v2/creatives/video/115263",
"file_name": "creative.zip",
"mime_type": "application/zip",
"has_click_macro": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_rich_media_get |
Get a Single Rich Media Creative
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/rich-media/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/rich-media/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/rich-media/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/rich-media/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/rich-media/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to get. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"object": "rich_media_creative",
"id": 115263,
"self": "/v2/creatives/video/115263",
"file_name": "creative.zip",
"mime_type": "application/zip",
"has_click_macro": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_rich_media_get |
Update a Rich Media Creative
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/creatives/rich-media/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"description":"","group":87,"name":"Demo Creative"}'
var data = JSON.stringify({
"description": "",
"group": 87,
"name": "Demo Creative"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/creatives/rich-media/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/creatives/rich-media/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/creatives/rich-media/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media/0"
payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /creatives/rich-media/{id}
Body parameter
{
"description": "",
"group": 87,
"name": "Demo Creative"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to update. |
body | body | creative_rich_media_put | false | none |
» description | body | integer | false | A short description of the creative. |
» group | body | integer | false | The media group identifier (ID). |
» name | body | string | false | A descriptive name of the creative. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"object": "rich_media_creative",
"id": 115263,
"self": "/v2/creatives/video/115263",
"file_name": "creative.zip",
"mime_type": "application/zip",
"has_click_macro": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_rich_media_get |
Delete a Rich Media Creative
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/creatives/rich-media/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/creatives/rich-media/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/creatives/rich-media/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/creatives/rich-media/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /creatives/rich-media/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Replace the File on a Rich Media Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/rich-media/0/replace-file \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form 'attributes={"index_file_path":"path/to/index.html"}' \
--form file=@/path/to/archive.zip
var data = new FormData();
data.append("attributes", "{\"index_file_path\":\"path/to/index.html\"}");
data.append("file", "@/path/to/archive.zip");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/rich-media/0/replace-file");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/rich-media/0/replace-file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attributes\"\r\n\r\n{\"index_file_path\":\"path/to/index.html\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attributes\"\r\n\r\n{\"index_file_path\":\"path/to/index.html\"}"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/rich-media/0/replace-file", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/rich-media/0/replace-file")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attributes\"\r\n\r\n{\"index_file_path\":\"path/to/index.html\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/rich-media/0/replace-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attributes\"\r\n\r\n{\"index_file_path\":\"path/to/index.html\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/rich-media/{id}/replace-file
Body parameter
attributes: '{"index_file_path":"path/to/index.html"}'
file: '@/path/to/archive.zip'
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to update. |
body | body | creative_rich_media_file_replace | false | none |
» attributes | body | string | false | none |
» file | body | string | true | The absolute or relative path to the rich media (ZIP) file. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"object": "rich_media_creative",
"id": 115263,
"self": "/v2/creatives/video/115263",
"file_name": "creative.zip",
"mime_type": "application/zip",
"has_click_macro": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_rich_media_get |
Creatives / Video
The video file that makes up an advertisement is known as the video creative. You can create a new video creative, retrieve one or more video creatives, update an existing video creative, or delete the video creative.
Get a List of Video Creatives
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/video \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/video");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/video", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/video")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/video
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"url": "/v2/creative/video",
"data": [
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "video_creative",
"id": 115262,
"self": "/v2/creatives/video/115262",
"file_name": "creative.mp4",
"mime_type": "video/mp4",
"video_data_rate": 329677,
"duration": 6
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_video_list |
Create a Video Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/video \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/video.mp4 \
--form 'attributes={"description":"This is a description", "group":55, "name":"This is a name."}'
var data = new FormData();
data.append("file", "@/path/to/video.mp4");
data.append("attributes", "{\"description\":\"This is a description\", \"group\":55, \"name\":\"This is a name.\"}");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/video");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/video", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/video")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/video
Body parameter
file: '@/path/to/video.mp4'
attributes: '{"description":"This is a description", "group":55, "name":"This is a name."}'
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | creative_video_post | false | none |
» file | body | string | true | The absolute or relative path to the video (FLV, MP4, WEBM, or OGG) file. |
» attributes | body | string | false | none |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "video_creative",
"id": 115262,
"self": "/v2/creatives/video/115262",
"file_name": "creative.mp4",
"mime_type": "video/mp4",
"video_data_rate": 329677,
"duration": 6
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_video_get |
Get a Single Video Creative
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/creatives/video/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/creatives/video/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/creatives/video/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/video/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /creatives/video/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to get. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "video_creative",
"id": 115262,
"self": "/v2/creatives/video/115262",
"file_name": "creative.mp4",
"mime_type": "video/mp4",
"video_data_rate": 329677,
"duration": 6
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_video_get |
Update a Video Creative
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/creatives/video/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"description":"","group":87,"name":"Demo Creative"}'
var data = JSON.stringify({
"description": "",
"group": 87,
"name": "Demo Creative"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/creatives/video/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/creatives/video/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/creatives/video/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video/0"
payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /creatives/video/{id}
Body parameter
{
"description": "",
"group": 87,
"name": "Demo Creative"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to update. |
body | body | creative_video_put | false | none |
» description | body | integer | false | A short description of the creative. |
» group | body | integer | false | The media group identifier (ID). |
» name | body | string | false | A descriptive name of the creative. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "video_creative",
"id": 115262,
"self": "/v2/creatives/video/115262",
"file_name": "creative.mp4",
"mime_type": "video/mp4",
"video_data_rate": 329677,
"duration": 6
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_video_get |
Delete a Video Creative
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/creatives/video/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/creatives/video/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/creatives/video/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/creatives/video/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /creatives/video/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the creative you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Replace the File on a Video Creative
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/creatives/video//replace-file \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form file=@/path/to/video.mp4
var data = new FormData();
data.append("file", "@/path/to/video.mp4");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/creatives/video//replace-file");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/creatives/video//replace-file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'multipart/form-data'
request["accept"] = 'application/json'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4"
headers = {
'content-type': "multipart/form-data",
'accept': "application/json"
}
conn.request("POST", "/v2/creatives/video//replace-file", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/video//replace-file")
.header("content-type", "multipart/form-data")
.header("accept", "application/json")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/creatives/video//replace-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n@/path/to/video.mp4")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "multipart/form-data")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /creatives/video/{id}/replace-file
Body parameter
file: '@/path/to/video.mp4'
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | creative_video_file_replace | false | none |
» file | body | string | true | The absolute or relative path to the video (FLV, MP4, WEBM, or OGG) file. |
Example responses
default Response
{
"description": "",
"group": 87,
"name": "Demo Creative",
"file_size": 329438,
"uploaded_time": "2019-04-21 13:22:59",
"height": 400,
"width": 650,
"object": "video_creative",
"id": 115262,
"self": "/v2/creatives/video/115262",
"file_name": "creative.mp4",
"mime_type": "video/mp4",
"video_data_rate": 329677,
"duration": 6
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | creative_video_get |
Data Key Targets
Get a List of Data Key Targets
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/data-key-targets \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/data-key-targets");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-key-targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/data-key-targets", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/data-key-targets")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-key-targets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /data-key-targets
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"data": [
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_target_list |
Create a Data Key Target
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/data-key-targets \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"my data key target 1","target":"[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"}'
var data = JSON.stringify({
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/data-key-targets");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-key-targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/data-key-targets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/data-key-targets")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-key-targets"
payload := strings.NewReader("{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /data-key-targets
Body parameter
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | data_key_target_post | false | none |
» name | body | string | false | The name of the data key target (Optional). |
» target | body | string | false | The JSON formatted target logic. |
Example responses
default Response
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_target_get |
Get a Single Data Key Target
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/data-key-targets/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/data-key-targets/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-key-targets/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/data-key-targets/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/data-key-targets/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-key-targets/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /data-key-targets/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key Target you'd like to get. |
Example responses
default Response
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_target_get |
Update a Data Key Target
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/data-key-targets/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"my data key target 1","target":"[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"}'
var data = JSON.stringify({
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/data-key-targets/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-key-targets/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/data-key-targets/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/data-key-targets/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-key-targets/0"
payload := strings.NewReader("{\"name\":\"my data key target 1\",\"target\":\"[\\\"OR\\\", {\\\"my_number\\\": {\\\"=\\\": \\\"5\\\"}}, {\\\"my_string\\\": {\\\"=\\\": \\\"test\\\"}}]\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /data-key-targets/{id}
Body parameter
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key Target you'd like to update. |
body | body | data_key_target_put | false | none |
» name | body | string | false | The name of the data key target (Optional). |
» target | body | string | false | The JSON formatted target logic. |
Example responses
default Response
{
"name": "my data key target 1",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_target_get |
Delete a Data Key Target
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/data-key-targets/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/data-key-targets/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-key-targets/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/data-key-targets/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/data-key-targets/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-key-targets/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /data-key-targets/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key Target you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Data Keys
Get a List of Data Keys
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/data-keys \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/data-keys");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/data-keys", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/data-keys")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /data-keys
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"data": [
{
"name": "my_string",
"type": "STRING",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_list |
Create a Data Key
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/data-keys \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"my_string","type":"STRING"}'
var data = JSON.stringify({
"name": "my_string",
"type": "STRING"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/data-keys");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"my_string\",\"type\":\"STRING\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"my_string\",\"type\":\"STRING\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/data-keys", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/data-keys")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"my_string\",\"type\":\"STRING\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-keys"
payload := strings.NewReader("{\"name\":\"my_string\",\"type\":\"STRING\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /data-keys
Body parameter
{
"name": "my_string",
"type": "STRING"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | data_key_post | false | none |
» name | body | string | false | The name of the data key. Must be unique. |
» type | body | string | false | The type of key (STRING, NUMBER, DATE, DATETIME, TIME). |
Example responses
default Response
{
"name": "my_string",
"type": "STRING",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_get |
Get a Single Data Key
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/data-keys/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/data-keys/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-keys/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/data-keys/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/data-keys/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-keys/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /data-keys/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key you'd like to get. |
Example responses
default Response
{
"name": "my_string",
"type": "STRING",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_get |
Update a Data Key
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/data-keys/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"my_string","type":"STRING"}'
var data = JSON.stringify({
"name": "my_string",
"type": "STRING"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/data-keys/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-keys/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"my_string\",\"type\":\"STRING\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"my_string\",\"type\":\"STRING\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/data-keys/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/data-keys/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"my_string\",\"type\":\"STRING\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-keys/0"
payload := strings.NewReader("{\"name\":\"my_string\",\"type\":\"STRING\"}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /data-keys/{id}
Body parameter
{
"name": "my_string",
"type": "STRING"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key you'd like to update. |
body | body | data_key_put | false | none |
» name | body | string | false | The name of the data key. Must be unique. |
» type | body | string | false | The type of key (STRING, NUMBER, DATE, DATETIME, TIME). |
Example responses
default Response
{
"name": "my_string",
"type": "STRING",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | data_key_get |
Delete a Data Key
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/data-keys/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/data-keys/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/data-keys/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/data-keys/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/data-keys/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/data-keys/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /data-keys/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the Data Key you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Day Parting
Day parting allows you to specify particular hours in which your ads will be served. This is done with a list of ranges. (E.G. '10:00:00-11:00:00')
You can optionally use your account's timezone. By default, the ad server's timezone will be used.
Get a list of Day Parting configurations
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/day-parting \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/day-parting");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/day-parting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/day-parting", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/day-parting")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/day-parting"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /day-parting
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"data": [
{
"ad_item_id": 555,
"object": "day_parting",
"self": "/v2/day-parting/1234",
"id": 1234
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | day_parting_list |
Create a Day Parting configuration.
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/day-parting \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"ad_item_id":555}'
var data = JSON.stringify({
"ad_item_id": 555
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/day-parting");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/day-parting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"ad_item_id\":555}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"ad_item_id\":555}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/day-parting", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/day-parting")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"ad_item_id\":555}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/day-parting"
payload := strings.NewReader("{\"ad_item_id\":555}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /day-parting
Body parameter
{
"ad_item_id": 555
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | day_parting_post | false | none |
» ad_item_id | body | integer | false | The ID of the VAST ad item that your tracking events will be attached to. |
Example responses
default Response
{
"ad_item_id": 555,
"object": "day_parting",
"self": "/v2/day-parting/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | day_parting_get |
Get a single Day Parting configuration.
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/day-parting/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/day-parting/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/day-parting/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/day-parting/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/day-parting/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/day-parting/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /day-parting/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the day parting config you'd like to get. |
Example responses
default Response
{
"ad_item_id": 555,
"object": "day_parting",
"self": "/v2/day-parting/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | day_parting_get |
Update a Day Parting Link
Code samples
curl --request PUT \
--url https://api.adbutler.com/v2/day-parting/0 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"ad_item_id":555}'
var data = JSON.stringify({
"ad_item_id": 555
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("PUT", "https://api.adbutler.com/v2/day-parting/0");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/day-parting/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"ad_item_id\":555}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"ad_item_id\":555}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("PUT", "/v2/day-parting/0", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/day-parting/0")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"ad_item_id\":555}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/day-parting/0"
payload := strings.NewReader("{\"ad_item_id\":555}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /day-parting/{id}
Body parameter
{
"ad_item_id": 555
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the day parting config you'd like to update. |
body | body | day_parting_put | false | none |
» ad_item_id | body | integer | false | The ID of the VAST ad item that your tracking events will be attached to. |
Example responses
default Response
{
"ad_item_id": 555,
"object": "day_parting",
"self": "/v2/day-parting/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | day_parting_get |
Delete a Day Parting configuration
Code samples
curl --request DELETE \
--url https://api.adbutler.com/v2/day-parting/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api.adbutler.com/v2/day-parting/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/day-parting/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("DELETE", "/v2/day-parting/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/day-parting/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/day-parting/0"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /day-parting/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the day parting config you'd like to delete. |
Example responses
default Response
{
"id": 1362,
"deleted": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | deleted |
Demand Endpoints
Third-party endpoints from which bids will be requested. Bids requested from these Endpoints will participate in auctions where the highest bidder will win the impression. Note: This endpoint is only enabled if you have the Programmatic Add-on.
Get a List of Demand Endpoints
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/demand-endpoints \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/demand-endpoints");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/demand-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/demand-endpoints", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/demand-endpoints")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/demand-endpoints"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /demand-endpoints
Returns a list of demand endpoints. If no demand endpoints were found, the data object will be empty.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | path | integer | false | The number of objects returned in the response, sometimes called "take". |
offset | path | integer | false | The position to start the retrieval of objects, sometimes called "skip". |
id | path | string | false | A list of IDs by which to filter the list of objects returned. Formatted as a list of the IDs separated by commas. (e.g. "1134,1153,1138,1176") |
Example responses
default Response
{
"object": "list",
"has_more": false,
"limit": 10,
"offset": 0,
"data": [
{
"name": "Display - US West",
"demand_source": 1234,
"default_parameters": {
"url": "https://rtbendpoints.com/endpoint123?uid=5"
},
"supported_formats": [
"display"
],
"bid_floor": 0.75,
"revenue_share": 85,
"markup_percent": 15,
"allowed_sizes": [
"300x250",
"728x90"
],
"priority": "standard",
"geo_target": null,
"filter_type": "all",
"filtered_zones": [
1234,
1235
],
"filtered_vast_zones": [
1234,
1235
],
"status": "active",
"object": "demand_endpoint",
"self": "/v2/demand-endpoints/1234",
"id": 1234
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | demand_endpoint_list |
Create a Demand Endpoint
Code samples
curl --request POST \
--url https://api.adbutler.com/v2/demand-endpoints \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"name":"Display - US West","demand_source":1234,"default_parameters":{"url":"https://rtbendpoints.com/endpoint123?uid=5"},"supported_formats":["display"],"bid_floor":0.75,"revenue_share":85,"markup_percent":15,"allowed_sizes":["300x250","728x90"],"priority":"standard","geo_target":null,"filter_type":"all","filtered_zones":[1234,1235],"filtered_vast_zones":[1234,1235],"status":"active"}'
var data = JSON.stringify({
"name": "Display - US West",
"demand_source": 1234,
"default_parameters": {
"url": "https://rtbendpoints.com/endpoint123?uid=5"
},
"supported_formats": [
"display"
],
"bid_floor": 0.75,
"revenue_share": 85,
"markup_percent": 15,
"allowed_sizes": [
"300x250",
"728x90"
],
"priority": "standard",
"geo_target": null,
"filter_type": "all",
"filtered_zones": [
1234,
1235
],
"filtered_vast_zones": [
1234,
1235
],
"status": "active"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.adbutler.com/v2/demand-endpoints");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/demand-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"name\":\"Display - US West\",\"demand_source\":1234,\"default_parameters\":{\"url\":\"https://rtbendpoints.com/endpoint123?uid=5\"},\"supported_formats\":[\"display\"],\"bid_floor\":0.75,\"revenue_share\":85,\"markup_percent\":15,\"allowed_sizes\":[\"300x250\",\"728x90\"],\"priority\":\"standard\",\"geo_target\":null,\"filter_type\":\"all\",\"filtered_zones\":[1234,1235],\"filtered_vast_zones\":[1234,1235],\"status\":\"active\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
payload = "{\"name\":\"Display - US West\",\"demand_source\":1234,\"default_parameters\":{\"url\":\"https://rtbendpoints.com/endpoint123?uid=5\"},\"supported_formats\":[\"display\"],\"bid_floor\":0.75,\"revenue_share\":85,\"markup_percent\":15,\"allowed_sizes\":[\"300x250\",\"728x90\"],\"priority\":\"standard\",\"geo_target\":null,\"filter_type\":\"all\",\"filtered_zones\":[1234,1235],\"filtered_vast_zones\":[1234,1235],\"status\":\"active\"}"
headers = {
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/v2/demand-endpoints", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/demand-endpoints")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"name\":\"Display - US West\",\"demand_source\":1234,\"default_parameters\":{\"url\":\"https://rtbendpoints.com/endpoint123?uid=5\"},\"supported_formats\":[\"display\"],\"bid_floor\":0.75,\"revenue_share\":85,\"markup_percent\":15,\"allowed_sizes\":[\"300x250\",\"728x90\"],\"priority\":\"standard\",\"geo_target\":null,\"filter_type\":\"all\",\"filtered_zones\":[1234,1235],\"filtered_vast_zones\":[1234,1235],\"status\":\"active\"}")
.asString();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/demand-endpoints"
payload := strings.NewReader("{\"name\":\"Display - US West\",\"demand_source\":1234,\"default_parameters\":{\"url\":\"https://rtbendpoints.com/endpoint123?uid=5\"},\"supported_formats\":[\"display\"],\"bid_floor\":0.75,\"revenue_share\":85,\"markup_percent\":15,\"allowed_sizes\":[\"300x250\",\"728x90\"],\"priority\":\"standard\",\"geo_target\":null,\"filter_type\":\"all\",\"filtered_zones\":[1234,1235],\"filtered_vast_zones\":[1234,1235],\"status\":\"active\"}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /demand-endpoints
Body parameter
{
"name": "Display - US West",
"demand_source": 1234,
"default_parameters": {
"url": "https://rtbendpoints.com/endpoint123?uid=5"
},
"supported_formats": [
"display"
],
"bid_floor": 0.75,
"revenue_share": 85,
"markup_percent": 15,
"allowed_sizes": [
"300x250",
"728x90"
],
"priority": "standard",
"geo_target": null,
"filter_type": "all",
"filtered_zones": [
1234,
1235
],
"filtered_vast_zones": [
1234,
1235
],
"status": "active"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | demand_endpoint_post | false | none |
» name | body | string | true | Name of the Demand Endpoint. |
» demand_source | body | integer | false | The identifier (ID) of the Demand Source that this Endpoint belongs to. |
» default_parameters | body | object | true | Each endpoint has a set number of parameters that are required to properly communicate with it. This field is where you can set those values as a default for the Demand Endpoint as a whole. |
» supported_formats | body | [string] | false | Indicates the supported ad formats. This is an array that contains one or more of 'display' or 'video' |
» bid_floor | body | float | false | The default CPM bid floor for this endpoint. If bids responses are received with bids below this floor, they will not be considered in the auction. |
» revenue_share | body | float | false | If the endpoint wins the auction, this is the percentage of the revenue that will be paid out to the publisher. |
» markup_percent | body | float | false | If a bid floor is set on the zone that is asking for a bid from this endpoint, this markup percent will increase the bid floor by this percentage before sending it to the endpoint. |
» allowed_sizes | body | [string] | false | If the endpoint supports 'display' ad formats, this array will indicate which zone sizes will have access to this endpoint. |
» priority | body | string | false | A value specifying whether to prefer serving of some ads over others in a campaign or channel. Allowable include: 'sponsorship', 'standard', 'network', 'bulk', 'house' |
» geo_target | body | integer | false | The geotarget identifier (ID) if you want your ads to be delivered to a particular location only. This will direct your audience to ads in their region. Defaults to null which means geographic targeting is not in effect. |
» filter_type | body | string | false | Indicates the type of zone filtering to employ for this endpoint. 'all' will target all zones, 'whitelist' will target zones only in the list, and 'blacklist' will target all zones except those in the list. |
» filtered_zones | body | [integer] | false | Array of zone identifiers (IDs) to add to the filter list. |
» filtered_vast_zones | body | [integer] | false | Array of VAST zone identifiers (IDs) to add to the filter list. |
» status | body | string | false | Indicates whether or not to send bid requests to this endpoint. Either 'active' or 'inactive'. Defaults to 'active'. |
Example responses
default Response
{
"name": "Display - US West",
"demand_source": 1234,
"default_parameters": {
"url": "https://rtbendpoints.com/endpoint123?uid=5"
},
"supported_formats": [
"display"
],
"bid_floor": 0.75,
"revenue_share": 85,
"markup_percent": 15,
"allowed_sizes": [
"300x250",
"728x90"
],
"priority": "standard",
"geo_target": null,
"filter_type": "all",
"filtered_zones": [
1234,
1235
],
"filtered_vast_zones": [
1234,
1235
],
"status": "active",
"object": "demand_endpoint",
"self": "/v2/demand-endpoints/1234",
"id": 1234
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | successful operation | demand_endpoint_get |
Get a Single Demand Endpoint
Code samples
curl --request GET \
--url https://api.adbutler.com/v2/demand-endpoints/0 \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.adbutler.com/v2/demand-endpoints/0");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
require 'uri'
require 'net/http'
url = URI("https://api.adbutler.com/v2/demand-endpoints/0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("api.adbutler.com")
headers = { 'accept': "application/json" }
conn.request("GET", "/v2/demand-endpoints/0", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/demand-endpoints/0")
.header("accept", "application/json")
.asString();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.adbutler.com/v2/demand-endpoints/0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /demand-endpoints/{id}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Identifier of the demand endpoint you'd like to get. |
Example responses
default Response
{
"name": "Display - US West",
"demand_source": 1234,
"default_parameters": {
"url": "https://rtbendpoints.com/endpoint123?uid=5"
},
"supported_formats": [
"display"
],
"bid_floor": 0.75,
"revenue_share": 85,
"markup_percent": 15,
"allowed_sizes": [
"300x250",
"728x90"
],
"priority": "standard",
"geo