NAV Navigation
Shell JavaScript Ruby Python Java Go

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

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" and depth=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

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

{
  "url": "/v2/ad-items",
  "data": [
    {
      "object": "image_ad_item",
      "self": "/v2/ad-items/image/675265899",
      "id": 675265899,
      "flexible_type": 0,
      "is_self_serve": "true",
      "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": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation ad_item_list

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

{
  "url": "/v2/ad-items/image",
  "data": [
    {
      "object": "image_ad_item",
      "self": "/v2/ad-items/image/675265899",
      "id": 675265899,
      "flexible_type": 0,
      "is_self_serve": "true",
      "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": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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 '{"flexible_type":0,"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({
  "flexible_type": 0,
  "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("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 = "{\"flexible_type\":0,\"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 = "{\"flexible_type\":0,\"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("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("{\"flexible_type\":0,\"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"

	payload := strings.NewReader("{\"flexible_type\":0,\"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("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

{
  "flexible_type": 0,
  "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
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

{
  "object": "image_ad_item",
  "self": "/v2/ad-items/image/675265899",
  "id": 675265899,
  "flexible_type": 0,
  "is_self_serve": "true",
  "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"
}

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

{
  "object": "image_ad_item",
  "self": "/v2/ad-items/image/675265899",
  "id": 675265899,
  "flexible_type": 0,
  "is_self_serve": "true",
  "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"
}

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

{
  "object": "image_ad_item",
  "self": "/v2/ad-items/image/675265899",
  "id": 675265899,
  "flexible_type": 0,
  "is_self_serve": "true",
  "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"
}

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

{
  "url": "/v2/ad-items/image/675265899/conversion-tag",
  "object": "conv_tag",
  "data": {
    "src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
    "html": "<img />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation image_ad_item_conversion_tag

Ad Items / Flash

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).

Get a List of Flash Ad Items

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

Example responses

default Response

{
  "url": "/v2/ad-items/flash",
  "data": [
    {
      "object": "flash_ad_item",
      "self": "/v2/ad-items/flash/958422568",
      "id": 958422568,
      "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": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation flash_ad_item_list

Create a Flash Ad Item

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

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:

  • "window": the SWF content plays in its own rectangle ("window") on a web page. You cannot explicitly specify if SWF content appears above or below other HTML elements on the page.
  • "opaque" (default): The SWF content is layered together with other HTML elements on the page. The SWF file is opaque and hides everything layered behind it on the page. This option reduces playback performance compared to the "window" mode.
  • "transparent": The SWF content is layered together with other HTML elements on the page. The SWF file background color is transparent. HTML elements beneath the SWF file are visible through any transparent areas of the SWF. This option reduces playback performance compared to the "window" mode.

More information can be found here.

» quality body string false The quality of the flash image or movie. Accepted values are:

  • "low": favors playback speed over appearance and never uses anti-aliasing.
  • "medium": applies some anti-aliasing and does not smooth bitmaps.
  • "high" (default): favors appearance over playback speed and always applies anti-aliasing. If the movie has animation, bitmaps are not smoothed.

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

{
  "object": "flash_ad_item",
  "self": "/v2/ad-items/flash/958422568",
  "id": 958422568,
  "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"
}

Responses

Status Meaning Description Schema
default Default successful operation flash_ad_item_get

Get a Single Flash Ad Item

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}

Parameters

Name In Type Required Description
id path integer true Identifier of the ad item you'd like to get.

Example responses

default Response

{
  "object": "flash_ad_item",
  "self": "/v2/ad-items/flash/958422568",
  "id": 958422568,
  "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"
}

Responses

Status Meaning Description Schema
default Default successful operation flash_ad_item_get

Update a Flash Ad Item

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}

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:

  • "window": the SWF content plays in its own rectangle ("window") on a web page. You cannot explicitly specify if SWF content appears above or below other HTML elements on the page.
  • "opaque" (default): The SWF content is layered together with other HTML elements on the page. The SWF file is opaque and hides everything layered behind it on the page. This option reduces playback performance compared to the "window" mode.
  • "transparent": The SWF content is layered together with other HTML elements on the page. The SWF file background color is transparent. HTML elements beneath the SWF file are visible through any transparent areas of the SWF. This option reduces playback performance compared to the "window" mode.

More information can be found here.

» quality body string false The quality of the flash image or movie. Accepted values are:

  • "low": favors playback speed over appearance and never uses anti-aliasing.
  • "medium": applies some anti-aliasing and does not smooth bitmaps.
  • "high" (default): favors appearance over playback speed and always applies anti-aliasing. If the movie has animation, bitmaps are not smoothed.

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

{
  "object": "flash_ad_item",
  "self": "/v2/ad-items/flash/958422568",
  "id": 958422568,
  "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"
}

Responses

Status Meaning Description Schema
default Default successful operation flash_ad_item_get

Delete a Flash Ad Item

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}

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

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

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

{
  "url": "/v2/ad-items/flash/958422568/conversion-tag",
  "object": "conv_tag",
  "data": {
    "src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
    "html": "<img />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation flash_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

{
  "url": "/v2/ad-items/rich-media",
  "data": [
    {
      "object": "rich_media_ad_item",
      "self": "/v2/ad-items/rich-media/745558692",
      "id": 745558692,
      "is_self_serve": "true",
      "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",
      "html_path": null,
      "created_date": "2019-04-26 14:55:31",
      "last_modified": "2019-04-26 14:55:39"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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","html_path":null}'
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",
  "html_path": 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/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\",\"html_path\":null}"

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\",\"html_path\":null}"

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\",\"html_path\":null}")
  .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\",\"html_path\":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 /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",
  "html_path": null
}

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".
» html_path body string false The relative path to the HTML content that will appear below the rich media ad item.

Example responses

default Response

{
  "object": "rich_media_ad_item",
  "self": "/v2/ad-items/rich-media/745558692",
  "id": 745558692,
  "is_self_serve": "true",
  "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",
  "html_path": null,
  "created_date": "2019-04-26 14:55:31",
  "last_modified": "2019-04-26 14:55:39"
}

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

{
  "object": "rich_media_ad_item",
  "self": "/v2/ad-items/rich-media/745558692",
  "id": 745558692,
  "is_self_serve": "true",
  "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",
  "html_path": null,
  "created_date": "2019-04-26 14:55:31",
  "last_modified": "2019-04-26 14:55:39"
}

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","html_path":null}'
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",
  "html_path": 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/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\",\"html_path\":null}"

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\",\"html_path\":null}"

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\",\"html_path\":null}")
  .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\",\"html_path\":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 /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",
  "html_path": null
}

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".
» html_path body string false The relative path to the HTML content that will appear below the rich media ad item.

Example responses

default Response

{
  "object": "rich_media_ad_item",
  "self": "/v2/ad-items/rich-media/745558692",
  "id": 745558692,
  "is_self_serve": "true",
  "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",
  "html_path": null,
  "created_date": "2019-04-26 14:55:31",
  "last_modified": "2019-04-26 14:55:39"
}

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

{
  "url": "/v2/ad-items/rich-media/745558692/conversion-tag",
  "object": "conv_tag",
  "data": {
    "src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
    "html": "<img />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation rich_media_ad_item_conversion_tag

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

{
  "url": "/v2/ad-items/custom-html",
  "data": [
    {
      "object": "custom_html_ad_item",
      "self": "/v2/ad-items/custom-html/985124765",
      "id": 985124765,
      "is_self_serve": "true",
      "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": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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

{
  "object": "custom_html_ad_item",
  "self": "/v2/ad-items/custom-html/985124765",
  "id": 985124765,
  "is_self_serve": "true",
  "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"
}

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

{
  "object": "custom_html_ad_item",
  "self": "/v2/ad-items/custom-html/985124765",
  "id": 985124765,
  "is_self_serve": "true",
  "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"
}

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

{
  "object": "custom_html_ad_item",
  "self": "/v2/ad-items/custom-html/985124765",
  "id": 985124765,
  "is_self_serve": "true",
  "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"
}

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

{
  "url": "/v2/ad-items/custom-html/985124765/conversion-tag",
  "object": "conv_tag",
  "data": {
    "src": "https://servedbyadbutler.com/convtrack.spark?MID=123456789",
    "html": "<img />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation custom_html_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

{
  "url": "/v2/advertisers",
  "data": [
    {
      "self": "/v2/advertisers/5195",
      "parent": "admin",
      "object": "advertiser",
      "id": 5195,
      "has_password": true,
      "can_change_password": true,
      "can_add_ad_items": true,
      "email": "advertiser@adbutler.com",
      "name": "Example Advertiser"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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 '{"password":"VeRy_SeCuRe_PaSsWoRd","can_change_password":true,"can_add_ad_items":true,"email":"advertiser@adbutler.com","name":"Example Advertiser"}'
var data = JSON.stringify({
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
});

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 = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}"

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("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/advertisers"

	payload := strings.NewReader("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}")

	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

{
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
}

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.
» email 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. 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

{
  "self": "/v2/advertisers/5195",
  "parent": "admin",
  "object": "advertiser",
  "id": 5195,
  "has_password": true,
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
}

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

{
  "url": "/v2/advertisers/archived",
  "data": [
    {
      "self": "/v2/advertisers/archived/5195",
      "object": "advertiser",
      "id": 5195,
      "has_password": true,
      "can_change_password": true,
      "can_add_ad_items": true,
      "email": "advertiser@adbutler.com",
      "name": "Example Advertiser",
      "archived": true,
      "archived_on": "2019-01-25 11:00:00"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation archived_advertiser_list

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 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

{
  "self": "/v2/advertisers/archived/5195",
  "object": "advertiser",
  "id": 5195,
  "has_password": true,
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser",
  "archived": true,
  "archived_on": "2019-01-25 11:00:00"
}

Responses

Status Meaning Description Schema
default Default successful operation archived_advertiser_get

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

{
  "self": "/v2/advertisers/5195",
  "parent": "admin",
  "object": "advertiser",
  "id": 5195,
  "has_password": true,
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
}

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 '{"password":"VeRy_SeCuRe_PaSsWoRd","can_change_password":true,"can_add_ad_items":true,"email":"advertiser@adbutler.com","name":"Example Advertiser"}'
var data = JSON.stringify({
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
});

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 = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}"

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("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/advertisers/0"

	payload := strings.NewReader("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"can_change_password\":true,\"can_add_ad_items\":true,\"email\":\"advertiser@adbutler.com\",\"name\":\"Example Advertiser\"}")

	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

{
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
}

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.
» email 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. 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

{
  "self": "/v2/advertisers/5195",
  "parent": "admin",
  "object": "advertiser",
  "id": 5195,
  "has_password": true,
  "can_change_password": true,
  "can_add_ad_items": true,
  "email": "advertiser@adbutler.com",
  "name": "Example Advertiser"
}

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

{
  "url": "/v2/bidders",
  "data": [
    {
      "object": "bidder",
      "id": 6899,
      "self": "/v2/bidders/6899",
      "created_date": "2019-03-27 18:43:52",
      "bidder_code": "adbutler",
      "name": "AdButler Bidder",
      "parameters": {
        "accountID": "123456789",
        "keyword": "cats,kittens",
        "maxCPM": "3.0",
        "minCPM": "1.0",
        "zoneID": "5658"
      }
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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 bidder_parameter_example 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

{
  "object": "bidder",
  "id": 6899,
  "self": "/v2/bidders/6899",
  "created_date": "2019-03-27 18:43:52",
  "bidder_code": "adbutler",
  "name": "AdButler Bidder",
  "parameters": {
    "accountID": "123456789",
    "keyword": "cats,kittens",
    "maxCPM": "3.0",
    "minCPM": "1.0",
    "zoneID": "5658"
  }
}

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

{
  "object": "bidder",
  "id": 6899,
  "self": "/v2/bidders/6899",
  "created_date": "2019-03-27 18:43:52",
  "bidder_code": "adbutler",
  "name": "AdButler Bidder",
  "parameters": {
    "accountID": "123456789",
    "keyword": "cats,kittens",
    "maxCPM": "3.0",
    "minCPM": "1.0",
    "zoneID": "5658"
  }
}

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 bidder_parameter_example 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

{
  "object": "bidder",
  "id": 6899,
  "self": "/v2/bidders/6899",
  "created_date": "2019-03-27 18:43:52",
  "bidder_code": "adbutler",
  "name": "AdButler Bidder",
  "parameters": {
    "accountID": "123456789",
    "keyword": "cats,kittens",
    "maxCPM": "3.0",
    "minCPM": "1.0",
    "zoneID": "5658"
  }
}

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

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

default Response

{
  "data": [
    {
      "object": "standard_campaign",
      "self": "/v2/campaigns/standard/1234",
      "id": 1234,
      "name": "Example Standard Campaign",
      "advertiser": 633215,
      "roadblock_tags": null,
      "flexible_type": 0
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation standard_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

default Response

{
  "data": [
    {
      "object": "standard_campaign",
      "self": "/v2/campaigns/standard/1234",
      "id": 1234,
      "name": "Example Standard Campaign",
      "advertiser": 633215,
      "roadblock_tags": null,
      "flexible_type": 0
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default 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 '{"name":"Example Standard Campaign","advertiser":633215,"roadblock_tags":null,"flexible_type":0}'
var data = JSON.stringify({
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "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/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 = "{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}"

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("{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/standard"

	payload := strings.NewReader("{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"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 /campaigns/standard

Body parameter

{
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "flexible_type": 0
}

Parameters

Name In Type Required Description
body body standard_campaign_post false none
» name body string true The name of the campaign.
» advertiser body integer false The advertiser identifier (ID).
» roadblock_tags body string false The tag to link this campaign to a roadblock.
» 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)

Example responses

default Response

{
  "object": "standard_campaign",
  "self": "/v2/campaigns/standard/1234",
  "id": 1234,
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "flexible_type": 0
}

Responses

Status Meaning Description Schema
default Default successful operation standard_campaign_get

Get a Single Standard Campaign

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/standard/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/standard/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 /campaigns/standard/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to get.

Example responses

default Response

{
  "object": "standard_campaign",
  "self": "/v2/campaigns/standard/1234",
  "id": 1234,
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "flexible_type": 0
}

Responses

Status Meaning Description Schema
default Default successful operation standard_campaign_get

Update a Standard Campaign

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/campaigns/standard/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"Example Standard Campaign","advertiser":633215,"roadblock_tags":null,"flexible_type":0}'
var data = JSON.stringify({
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "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("PUT", "https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/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 Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/campaigns/standard/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/campaigns/standard/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/standard/0"

	payload := strings.NewReader("{\"name\":\"Example Standard Campaign\",\"advertiser\":633215,\"roadblock_tags\":null,\"flexible_type\":0}")

	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

{
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "flexible_type": 0
}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to update.
body body standard_campaign_put false none
» name body string false The name of the campaign.
» advertiser body integer false The advertiser identifier (ID).
» roadblock_tags body string false The tag to link this campaign to a roadblock.
» 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)

Example responses

default Response

{
  "object": "standard_campaign",
  "self": "/v2/campaigns/standard/1234",
  "id": 1234,
  "name": "Example Standard Campaign",
  "advertiser": 633215,
  "roadblock_tags": null,
  "flexible_type": 0
}

Responses

Status Meaning Description Schema
default Default successful operation standard_campaign_get

Delete a Standard Campaign

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/standard/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/standard/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 /campaigns/standard/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Retrieve Standard Campaign Conversion Tag

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/standard/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/campaigns/standard/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/campaigns/standard/0/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/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 /campaigns/standard/{id}/conversion-tag

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign 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 />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation conversion_tag

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

default Response

{
  "data": [
    {
      "object": "text_campaign",
      "self": "/v2/campaigns/text/1234",
      "id": 1234,
      "advertiser": 755124,
      "name": "Example Text Campaign"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default 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 Text Campaign"}'
var data = JSON.stringify({
  "advertiser": 755124,
  "name": "Example Text 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 Text Campaign\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"advertiser\":755124,\"name\":\"Example Text 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 Text 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 Text 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 Text Campaign"
}

Parameters

Name In Type Required Description
body body text_campaign_post false none
» advertiser body integer false The advertiser identifier (ID).
» name body string true The name of the campaign.

Example responses

default Response

{
  "object": "text_campaign",
  "self": "/v2/campaigns/text/1234",
  "id": 1234,
  "advertiser": 755124,
  "name": "Example Text Campaign"
}

Responses

Status Meaning Description Schema
default Default successful operation text_campaign_get

Get a Single Text Campaign

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/campaigns/text/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/text/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 /campaigns/text/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to get.

Example responses

default Response

{
  "object": "text_campaign",
  "self": "/v2/campaigns/text/1234",
  "id": 1234,
  "advertiser": 755124,
  "name": "Example Text Campaign"
}

Responses

Status Meaning Description Schema
default Default successful operation text_campaign_get

Update a Text Campaign

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/campaigns/text/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"advertiser":755124,"name":"Example Text Campaign"}'
var data = JSON.stringify({
  "advertiser": 755124,
  "name": "Example Text 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/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/campaigns/text/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 = "{\"advertiser\":755124,\"name\":\"Example Text Campaign\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"advertiser\":755124,\"name\":\"Example Text Campaign\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/campaigns/text/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/campaigns/text/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"advertiser\":755124,\"name\":\"Example Text Campaign\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/text/0"

	payload := strings.NewReader("{\"advertiser\":755124,\"name\":\"Example Text 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 Text Campaign"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to update.
body body text_campaign_put false none
» advertiser body integer false The advertiser identifier (ID).
» name body string false The name of the campaign.

Example responses

default Response

{
  "object": "text_campaign",
  "self": "/v2/campaigns/text/1234",
  "id": 1234,
  "advertiser": 755124,
  "name": "Example Text Campaign"
}

Responses

Status Meaning Description Schema
default Default successful operation text_campaign_get

Delete a Text Campaign

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/campaigns/text/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/campaigns/text/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 /campaigns/text/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Retrieve Text Campaign Conversion Tag

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/0/conversion-tag");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/campaigns/text/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/campaigns/text/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/campaigns/text/0/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/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 /campaigns/text/{id}/conversion-tag

Parameters

Name In Type Required Description
id path integer true Identifier of the campaign 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 />"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation conversion_tag

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

{
  "data": [
    {
      "object": "campaign_assignment",
      "id": 8247,
      "self": "/v2/campaign-assignments/8247",
      "active": true,
      "advertisement": {
        "id": 92213512,
        "type": "image_ad_item"
      },
      "campaign": {
        "id": 442135,
        "type": "standard_campaign"
      },
      "weight": 0
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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}'
var data = JSON.stringify({
  "active": true,
  "advertisement": {
    "id": 92213512,
    "type": "image_ad_item"
  },
  "campaign": {
    "id": 442135,
    "type": "standard_campaign"
  },
  "weight": 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/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}"

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}"

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}")
  .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}")

	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
}

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 campaign_assignment_advertisement_example 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 campaign_assignment_campaign_example 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.

Example responses

default Response

{
  "object": "campaign_assignment",
  "id": 8247,
  "self": "/v2/campaign-assignments/8247",
  "active": true,
  "advertisement": {
    "id": 92213512,
    "type": "image_ad_item"
  },
  "campaign": {
    "id": 442135,
    "type": "standard_campaign"
  },
  "weight": 0
}

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

{
  "object": "campaign_assignment",
  "id": 8247,
  "self": "/v2/campaign-assignments/8247",
  "active": true,
  "advertisement": {
    "id": 92213512,
    "type": "image_ad_item"
  },
  "campaign": {
    "id": 442135,
    "type": "standard_campaign"
  },
  "weight": 0
}

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}'
var data = JSON.stringify({
  "active": true,
  "advertisement": {
    "id": 92213512,
    "type": "image_ad_item"
  },
  "campaign": {
    "id": 442135,
    "type": "standard_campaign"
  },
  "weight": 0
});

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}"

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}"

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}")
  .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}")

	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
}

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 campaign_assignment_advertisement_example 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 campaign_assignment_campaign_example 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.

Example responses

default Response

{
  "object": "campaign_assignment",
  "id": 8247,
  "self": "/v2/campaign-assignments/8247",
  "active": true,
  "advertisement": {
    "id": 92213512,
    "type": "image_ad_item"
  },
  "campaign": {
    "id": 442135,
    "type": "standard_campaign"
  },
  "weight": 0
}

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

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

default Response

{
  "url": "/v2/channels",
  "data": [
    {
      "object": "channel",
      "id": 84522,
      "self": "/v2/channels/84522",
      "zones": [
        {
          "id": 5526,
          "type": "standard_zone"
        },
        {
          "id": 5387,
          "type": "standard_zone"
        }
      ],
      "name": "Low-Priority Channel",
      "priority": "house"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default 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"}'
var data = JSON.stringify({
  "name": "Low-Priority Channel",
  "priority": "house"
});

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\"}"

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\"}"

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\"}")
  .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\"}")

	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"
}

Parameters

Name In Type Required Description
body body channel_post false none
» name body string true A descriptive name of the channel.
» priority body string true 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.

Example responses

default Response

{
  "object": "channel",
  "id": 84522,
  "self": "/v2/channels/84522",
  "zones": [
    {
      "id": 5526,
      "type": "standard_zone"
    },
    {
      "id": 5387,
      "type": "standard_zone"
    }
  ],
  "name": "Low-Priority Channel",
  "priority": "house"
}

Responses

Status Meaning Description Schema
default Default successful operation channel_get

Get a Single Channel

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/channels/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/channels/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/channels/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/channels/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/channels/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/channels/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 /channels/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the channel you'd like to get.

Example responses

default Response

{
  "object": "channel",
  "id": 84522,
  "self": "/v2/channels/84522",
  "zones": [
    {
      "id": 5526,
      "type": "standard_zone"
    },
    {
      "id": 5387,
      "type": "standard_zone"
    }
  ],
  "name": "Low-Priority Channel",
  "priority": "house"
}

Responses

Status Meaning Description Schema
default Default successful operation channel_get

Update a Channel

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/channels/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"Low-Priority Channel","priority":"house"}'
var data = JSON.stringify({
  "name": "Low-Priority Channel",
  "priority": "house"
});

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/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/channels/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\":\"Low-Priority Channel\",\"priority\":\"house\"}"

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\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/channels/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/channels/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/channels/0"

	payload := strings.NewReader("{\"name\":\"Low-Priority Channel\",\"priority\":\"house\"}")

	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"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the channel you'd like to update.
body body channel_put false none
» name body string false 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.

Example responses

default Response

{
  "object": "channel",
  "id": 84522,
  "self": "/v2/channels/84522",
  "zones": [
    {
      "id": 5526,
      "type": "standard_zone"
    },
    {
      "id": 5387,
      "type": "standard_zone"
    }
  ],
  "name": "Low-Priority Channel",
  "priority": "house"
}

Responses

Status Meaning Description Schema
default Default successful operation channel_get

Delete a Channel

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/channels/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/channels/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/channels/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/channels/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/channels/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/channels/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 /channels/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the channel you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

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

{
  "url": "/v2/channel-zone-assignments",
  "data": [
    {
      "object": "channel_zone_assignment",
      "id": 442365,
      "self": "/v2/channel-zone-assignments/442365",
      "channel": 66245,
      "zone": {
        "id": 559124,
        "type": "standard_zone"
      }
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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 channel_zone_assignment_zone 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

{
  "object": "channel_zone_assignment",
  "id": 442365,
  "self": "/v2/channel-zone-assignments/442365",
  "channel": 66245,
  "zone": {
    "id": 559124,
    "type": "standard_zone"
  }
}

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

{
  "object": "channel_zone_assignment",
  "id": 442365,
  "self": "/v2/channel-zone-assignments/442365",
  "channel": 66245,
  "zone": {
    "id": 559124,
    "type": "standard_zone"
  }
}

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

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

{
  "url": "/v2/creatives/image",
  "data": [
    {
      "object": "image_creative",
      "id": 115260,
      "self": "/v2/creatives/image/115260",
      "file_name": "creative.png",
      "mime_type": "image/png",
      "file_size": 329438,
      "uploaded_time": "2019-04-21 13:22:59",
      "description": "",
      "group": 87,
      "name": "Demo Creative",
      "height": 400,
      "width": 650
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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

{
  "url": "/v2/creatives/image",
  "data": [
    {
      "object": "image_creative",
      "id": 115260,
      "self": "/v2/creatives/image/115260",
      "file_name": "creative.png",
      "mime_type": "image/png",
      "file_size": 329438,
      "uploaded_time": "2019-04-21 13:22:59",
      "description": "",
      "group": 87,
      "name": "Demo Creative",
      "height": 400,
      "width": 650
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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

{
  "object": "image_creative",
  "id": 115260,
  "self": "/v2/creatives/image/115260",
  "file_name": "creative.png",
  "mime_type": "image/png",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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

{
  "object": "image_creative",
  "id": 115260,
  "self": "/v2/creatives/image/115260",
  "file_name": "creative.png",
  "mime_type": "image/png",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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 '{"file":"path/to/image.png","description":"","group":87,"name":"Demo Creative"}'
var data = JSON.stringify({
  "file": "path/to/image.png",
  "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 = "{\"file\":\"path/to/image.png\",\"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 = "{\"file\":\"path/to/image.png\",\"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("{\"file\":\"path/to/image.png\",\"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("{\"file\":\"path/to/image.png\",\"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

{
  "file": "path/to/image.png",
  "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.
» file body string false The absolute or relative path to the image (JPEG, PNG, or GIF) file.

Example responses

default Response

{
  "object": "image_creative",
  "id": 115260,
  "self": "/v2/creatives/image/115260",
  "file_name": "creative.png",
  "mime_type": "image/png",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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

Creatives / Flash

The flash file that makes up an advertisement is known as the flash creative. You can create a new flash creative, retrieve one or more flash creatives, update an existing flash creative, or delete the flash creative.

Get a List of Flash Creatives

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/creatives/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/creatives/flash");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/creatives/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/creatives/flash", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/flash")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/creatives/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 /creatives/flash

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

{
  "url": "/v2/creative/flash",
  "data": [
    {
      "object": "flash_creative",
      "id": 115261,
      "self": "/v2/creatives/flash/115261",
      "file_name": "creative.swf",
      "mime_type": "application/x-shockwave-flash",
      "file_size": 329438,
      "uploaded_time": "2019-04-21 13:22:59",
      "description": "",
      "group": 87,
      "name": "Demo Creative",
      "height": 400,
      "width": 650
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation creative_flash_list

Create a Flash Creative

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/creatives/flash \
  --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("POST", "https://api.adbutler.com/v2/creatives/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/creatives/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 = "{\"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("POST", "/v2/creatives/flash", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/creatives/flash")
  .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/flash"

	payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")

	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 /creatives/flash

Body parameter

{
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

Parameters

Name In Type Required Description
body body creative_flash_post 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

{
  "object": "flash_creative",
  "id": 115261,
  "self": "/v2/creatives/flash/115261",
  "file_name": "creative.swf",
  "mime_type": "application/x-shockwave-flash",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

Responses

Status Meaning Description Schema
default Default successful operation creative_flash_get

Get a Single Flash Creative

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/creatives/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/creatives/flash/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/creatives/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/creatives/flash/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/creatives/flash/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/creatives/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 /creatives/flash/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the creative you'd like to get.

Example responses

default Response

{
  "object": "flash_creative",
  "id": 115261,
  "self": "/v2/creatives/flash/115261",
  "file_name": "creative.swf",
  "mime_type": "application/x-shockwave-flash",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

Responses

Status Meaning Description Schema
default Default successful operation creative_flash_get

Update a Flash Creative

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/creatives/flash/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/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/creatives/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 = "{\"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/flash/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/creatives/flash/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/flash/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/flash/{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_flash_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

{
  "object": "flash_creative",
  "id": 115261,
  "self": "/v2/creatives/flash/115261",
  "file_name": "creative.swf",
  "mime_type": "application/x-shockwave-flash",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

Responses

Status Meaning Description Schema
default Default successful operation creative_flash_get

Delete a Flash Creative

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/creatives/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/creatives/flash/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/creatives/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/creatives/flash/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/creatives/flash/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/creatives/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 /creatives/flash/{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

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

{
  "url": "/v2/creative/video",
  "data": [
    {
      "object": "video_creative",
      "id": 115262,
      "self": "/v2/creatives/video/115262",
      "file_name": "creative.mp4",
      "mime_type": "video/mp4",
      "video_data_rate": 329677,
      "duration": 6,
      "file_size": 329438,
      "uploaded_time": "2019-04-21 13:22:59",
      "description": "",
      "group": 87,
      "name": "Demo Creative",
      "height": 400,
      "width": 650
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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: 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("POST", "https://api.adbutler.com/v2/creatives/video");
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")

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 = "{\"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("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", "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"

	payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")

	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 /creatives/video

Body parameter

{
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

Parameters

Name In Type Required Description
body body creative_video_post 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

{
  "object": "video_creative",
  "id": 115262,
  "self": "/v2/creatives/video/115262",
  "file_name": "creative.mp4",
  "mime_type": "video/mp4",
  "video_data_rate": 329677,
  "duration": 6,
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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

{
  "object": "video_creative",
  "id": 115262,
  "self": "/v2/creatives/video/115262",
  "file_name": "creative.mp4",
  "mime_type": "video/mp4",
  "video_data_rate": 329677,
  "duration": 6,
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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

{
  "object": "video_creative",
  "id": 115262,
  "self": "/v2/creatives/video/115262",
  "file_name": "creative.mp4",
  "mime_type": "video/mp4",
  "video_data_rate": 329677,
  "duration": 6,
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative",
  "height": 400,
  "width": 650
}

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

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

{
  "url": "/v2/creative/rich-media",
  "data": [
    {
      "object": "rich_media_creative",
      "id": 115263,
      "self": "/v2/creatives/video/115263",
      "file_name": "creative.zip",
      "mime_type": "application/zip",
      "file_size": 329438,
      "uploaded_time": "2019-04-21 13:22:59",
      "description": "",
      "group": 87,
      "name": "Demo Creative"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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: 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("POST", "https://api.adbutler.com/v2/creatives/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/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"] = '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("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", "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"

	payload := strings.NewReader("{\"description\":\"\",\"group\":87,\"name\":\"Demo Creative\"}")

	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 /creatives/rich_media

Body parameter

{
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

Parameters

Name In Type Required Description
body body creative_rich_media_post 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

{
  "object": "rich_media_creative",
  "id": 115263,
  "self": "/v2/creatives/video/115263",
  "file_name": "creative.zip",
  "mime_type": "application/zip",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

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

{
  "object": "rich_media_creative",
  "id": 115263,
  "self": "/v2/creatives/video/115263",
  "file_name": "creative.zip",
  "mime_type": "application/zip",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

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

{
  "object": "rich_media_creative",
  "id": 115263,
  "self": "/v2/creatives/video/115263",
  "file_name": "creative.zip",
  "mime_type": "application/zip",
  "file_size": 329438,
  "uploaded_time": "2019-04-21 13:22:59",
  "description": "",
  "group": 87,
  "name": "Demo Creative"
}

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

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

{
  "data": [
    {
      "object": "demand_endpoint",
      "self": "/v2/demand-endpoints/1234",
      "id": 1234,
      "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": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

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

{
  "object": "demand_endpoint",
  "self": "/v2/demand-endpoints/1234",
  "id": 1234,
  "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"
}

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

{
  "object": "demand_endpoint",
  "self": "/v2/demand-endpoints/1234",
  "id": 1234,
  "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"
}

Responses

Status Meaning Description Schema
default Default successful operation demand_endpoint_get

Update a Demand Endpoint

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/demand-endpoints/0 \
  --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("PUT", "https://api.adbutler.com/v2/demand-endpoints/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/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::Put.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("PUT", "/v2/demand-endpoints/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/demand-endpoints/0")
  .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/0"

	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("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 /demand-endpoints/{id}

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
id path integer true Identifier of the demand endpoint you'd like to update.
body body demand_endpoint_put false none
» name body string false 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 false 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

{
  "object": "demand_endpoint",
  "self": "/v2/demand-endpoints/1234",
  "id": 1234,
  "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"
}

Responses

Status Meaning Description Schema
default Default successful operation demand_endpoint_get

Delete a Demand Endpoint

Code samples

curl --request DELETE \
  --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("DELETE", "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::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/demand-endpoints/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("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("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 /demand-endpoints/{id}

Permanently deletes a demand endpoint. This operation cannot be undone so be very sure when deleting one. Successful deletion immediately stops serving any bid requests from being sent

Parameters

Name In Type Required Description
id path integer true Identifier of the publisher you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Demand Sources

A Demand Source represents a partner who provides programmatic endpoints. This partner will either be one of our directly integrated networks or any network that is OpenRTB compatible. Note: This endpoint is only enabled if you have the Programmatic Add-on.

Get a List of Demand Sources

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/demand-sources \
  --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-sources");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/demand-sources")

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-sources", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/demand-sources")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/demand-sources"

	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-sources

Returns a list of demand sources. If no demand sources 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

{
  "data": [
    {
      "object": "demand_source",
      "self": "/v2/demand-sources/1234",
      "id": 1234,
      "name": "OpenRTB Partner",
      "network": "openrtb",
      "status": "active",
      "spend_limit": 30,
      "spend_limit_period": "weekly",
      "spend_limit_start": "2016-09-01T12:00:00-08:00",
      "spend_limit_end": "2016-09-01T12:00:00-08:00"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation demand_source_list

Create a Demand Source

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/demand-sources \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"OpenRTB Partner","network":"openrtb","status":"active","spend_limit":30,"spend_limit_period":"weekly","spend_limit_start":"2016-09-01T12:00:00-08:00","spend_limit_end":"2016-09-01T12:00:00-08:00"}'
var data = JSON.stringify({
  "name": "OpenRTB Partner",
  "network": "openrtb",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
});

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-sources");
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-sources")

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\":\"OpenRTB Partner\",\"network\":\"openrtb\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"OpenRTB Partner\",\"network\":\"openrtb\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/v2/demand-sources", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/demand-sources")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"OpenRTB Partner\",\"network\":\"openrtb\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/demand-sources"

	payload := strings.NewReader("{\"name\":\"OpenRTB Partner\",\"network\":\"openrtb\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}")

	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-sources

Body parameter

{
  "name": "OpenRTB Partner",
  "network": "openrtb",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
}

Parameters

Name In Type Required Description
body body demand_source_post false none
» name body string true Name of the Demand Source.
» network body string true The network that this Demand Source represents. One of 'adview', 'aerserv', 'inmobi', 'inneractive', 'loopme', 'mobilefuse', 'onebyaol', 'pubmatic', 'pubnative', 'smaato', 'startapp', 'tappx', 'consumable', 'bidphysics', or 'openrtb'.
» status body string false Indicates whether or not to send bid requests to the endpoints in this demand source. Either 'active' or 'inactive'. Defaults to 'active'.
» spend_limit body float false Limits the amount a Demand Source can spend. After reaching the spend limit, the Demand Source will not receive any more bid requests.
» spend_limit_period body string false The interval at which the spend limit should be reset. One of 'once', 'weekly', 'biweekly','monthly', or 'quarterly'.
» spend_limit_start body string false The date that the spend limit will begin in ISO-8601 format. Until this date the demand source will receive requests unlimited.
» spend_limit_end body string false The date that the spend limit will end in ISO-8601 format. After this date, the demand source will no longer be limited.

Example responses

default Response

{
  "object": "demand_source",
  "self": "/v2/demand-sources/1234",
  "id": 1234,
  "name": "OpenRTB Partner",
  "network": "openrtb",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
}

Responses

Status Meaning Description Schema
default Default successful operation demand_source_get

Get a Single Demand Source

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/demand-sources/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-sources/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/demand-sources/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-sources/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/demand-sources/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/demand-sources/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-sources/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the demand source you'd like to get.

Example responses

default Response

{
  "object": "demand_source",
  "self": "/v2/demand-sources/1234",
  "id": 1234,
  "name": "OpenRTB Partner",
  "network": "openrtb",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
}

Responses

Status Meaning Description Schema
default Default successful operation demand_source_get

Update a Demand Source

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/demand-sources/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"OpenRTB Partner","status":"active","spend_limit":30,"spend_limit_period":"weekly","spend_limit_start":"2016-09-01T12:00:00-08:00","spend_limit_end":"2016-09-01T12:00:00-08:00"}'
var data = JSON.stringify({
  "name": "OpenRTB Partner",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
});

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/demand-sources/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/demand-sources/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\":\"OpenRTB Partner\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"OpenRTB Partner\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/demand-sources/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/demand-sources/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"OpenRTB Partner\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/demand-sources/0"

	payload := strings.NewReader("{\"name\":\"OpenRTB Partner\",\"status\":\"active\",\"spend_limit\":30,\"spend_limit_period\":\"weekly\",\"spend_limit_start\":\"2016-09-01T12:00:00-08:00\",\"spend_limit_end\":\"2016-09-01T12:00:00-08:00\"}")

	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 /demand-sources/{id}

Body parameter

{
  "name": "OpenRTB Partner",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the demand source you'd like to update.
body body demand_source_put false none
» name body string false Name of the Demand Source.
» status body string false Indicates whether or not to send bid requests to the endpoints in this demand source. Either 'active' or 'inactive'. Defaults to 'active'.
» spend_limit body float false Limits the amount a Demand Source can spend. After reaching the spend limit, the Demand Source will not receive any more bid requests.
» spend_limit_period body string false The interval at which the spend limit should be reset. One of 'once', 'weekly', 'biweekly','monthly', or 'quarterly'.
» spend_limit_start body string false The date that the spend limit will begin in ISO-8601 format. Until this date the demand source will receive requests unlimited.
» spend_limit_end body string false The date that the spend limit will end in ISO-8601 format. After this date, the demand source will no longer be limited.

Example responses

default Response

{
  "object": "demand_source",
  "self": "/v2/demand-sources/1234",
  "id": 1234,
  "name": "OpenRTB Partner",
  "network": "openrtb",
  "status": "active",
  "spend_limit": 30,
  "spend_limit_period": "weekly",
  "spend_limit_start": "2016-09-01T12:00:00-08:00",
  "spend_limit_end": "2016-09-01T12:00:00-08:00"
}

Responses

Status Meaning Description Schema
default Default successful operation demand_source_get

Delete a Demand Source

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/demand-sources/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/demand-sources/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/demand-sources/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/demand-sources/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/demand-sources/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/demand-sources/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 /demand-sources/{id}

Permanently deletes a demand source. This operation cannot be undone so be very sure when deleting one. Successful deletion immediately stops serving any bid requests from being sent

Parameters

Name In Type Required Description
id path integer true Identifier of the publisher you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Geo Targets

Geographic targets ("geo targets") enable you to deliver advertisements to users based on their geographic location. This is an effective way of reducing wasted impressions and increasing your return on investment.

Geographic targeting can be as generic as continents or as specific as cities. A geo target may contain as many `area`s as desired which can vary in specificity. (i.e. an area of __"South America"__ and an area of a specific city could exist in the same geo target.) Geo targets can be inclusive or exclusive.

Get a List of Geo Targets

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/geo-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/geo-targets");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/geo-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/geo-targets", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/geo-targets")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/geo-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 /geo-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

{
  "url": "/v2/geo-targets",
  "data": [
    {
      "object": "geo_target",
      "id": 1796,
      "self": "/v2/geo-targets/1796",
      "areas": [
        {
          "country": "CA",
          "region": "Ontario",
          "city": "Toronto"
        }
      ],
      "range": 3,
      "unit": "kilometers",
      "inclusive": true,
      "name": "Toronto Area"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation geo_target_list

Create a Geo Target

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/geo-targets \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"areas":{"country":"CA","region":"Ontario","city":"Toronto"},"range":3,"unit":"kilometers","inclusive":true,"name":"Toronto Area"}'
var data = JSON.stringify({
  "areas": {
    "country": "CA",
    "region": "Ontario",
    "city": "Toronto"
  },
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
});

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/geo-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/geo-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 = "{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/v2/geo-targets", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/geo-targets")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/geo-targets"

	payload := strings.NewReader("{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}")

	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 /geo-targets

Body parameter

{
  "areas": {
    "country": "CA",
    "region": "Ontario",
    "city": "Toronto"
  },
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
}

Parameters

Name In Type Required Description
body body geo_target_post false none
» range body integer false The additional distance around the selected locations to include in the target.
» unit body string false The unit of distance for the range field. Accepted units are "miles" and "kilometers".
» inclusive body boolean false Whether it is an inclusion or an exclusion target.
» name body string true The name of the geographic target.
» areas body [geo_target_area_with_continent] true A list of areas to include in the geo target. Each area object represents some location on a map.
»» continent body string false Targets every country in the given continent. Possible values for the continent field are:

  • "Africa"
  • "Asia"
  • "Europe"
  • "Oceania"
  • "North America"
  • "South America"

If a country is given, continent is not needed.

»» country body string false The country field only accepts a two letter country code (e.g. "CA" for Canada). Do not include country if you do not wish to target by a specific country and wish to target by an entire continent instead.
»» region body string false The region to target. Do not include region if you do not wish to target by a specific region or city in the given country.
»» city body string false The city to target. Do not include city if you do not wish to target by a specific city in the given region.

Example responses

default Response

{
  "object": "geo_target",
  "id": 1796,
  "self": "/v2/geo-targets/1796",
  "areas": [
    {
      "country": "CA",
      "region": "Ontario",
      "city": "Toronto"
    }
  ],
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
}

Responses

Status Meaning Description Schema
default Default successful operation geo_target_get

Get a Single Geo Target

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/geo-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/geo-targets/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/geo-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/geo-targets/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/geo-targets/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/geo-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 /geo-targets/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the geo target you'd like to get.

Example responses

default Response

{
  "object": "geo_target",
  "id": 1796,
  "self": "/v2/geo-targets/1796",
  "areas": [
    {
      "country": "CA",
      "region": "Ontario",
      "city": "Toronto"
    }
  ],
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
}

Responses

Status Meaning Description Schema
default Default successful operation geo_target_get

Update a Geo Target

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/geo-targets/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"areas":{"country":"CA","region":"Ontario","city":"Toronto"},"range":3,"unit":"kilometers","inclusive":true,"name":"Toronto Area"}'
var data = JSON.stringify({
  "areas": {
    "country": "CA",
    "region": "Ontario",
    "city": "Toronto"
  },
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
});

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/geo-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/geo-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 = "{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/geo-targets/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/geo-targets/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/geo-targets/0"

	payload := strings.NewReader("{\"areas\":{\"country\":\"CA\",\"region\":\"Ontario\",\"city\":\"Toronto\"},\"range\":3,\"unit\":\"kilometers\",\"inclusive\":true,\"name\":\"Toronto Area\"}")

	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 /geo-targets/{id}

Body parameter

{
  "areas": {
    "country": "CA",
    "region": "Ontario",
    "city": "Toronto"
  },
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the geo target you'd like to update.
body body geo_target_put false none
» range body integer false The additional distance around the selected locations to include in the target.
» unit body string false The unit of distance for the range field. Accepted units are "miles" and "kilometers".
» inclusive body boolean false Whether it is an inclusion or an exclusion target.
» name body string false The name of the geographic target.
» areas body [geo_target_area_with_continent] false A list of areas to include in the geo target. Each area object represents some location on a map.
»» continent body string false Targets every country in the given continent. Possible values for the continent field are:

  • "Africa"
  • "Asia"
  • "Europe"
  • "Oceania"
  • "North America"
  • "South America"

If a country is given, continent is not needed.

»» country body string false The country field only accepts a two letter country code (e.g. "CA" for Canada). Do not include country if you do not wish to target by a specific country and wish to target by an entire continent instead.
»» region body string false The region to target. Do not include region if you do not wish to target by a specific region or city in the given country.
»» city body string false The city to target. Do not include city if you do not wish to target by a specific city in the given region.

Example responses

default Response

{
  "object": "geo_target",
  "id": 1796,
  "self": "/v2/geo-targets/1796",
  "areas": [
    {
      "country": "CA",
      "region": "Ontario",
      "city": "Toronto"
    }
  ],
  "range": 3,
  "unit": "kilometers",
  "inclusive": true,
  "name": "Toronto Area"
}

Responses

Status Meaning Description Schema
default Default successful operation geo_target_get

Delete a Geo Target

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/geo-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/geo-targets/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/geo-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/geo-targets/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/geo-targets/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/geo-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 /geo-targets/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the geo target you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Managers

A manager is an individual whom you wish to delegate some responsibility of managing your AdButler account. You can grant as much or as little access based on your needs. Managers can be granted permissions to add and manage other managers, advertisers, or publishers.

Get a List of Managers

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/managers \
  --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/managers");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/managers")

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/managers", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/managers")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/managers"

	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 /managers

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

{
  "url": "/v2/managers",
  "data": [
    {
      "object": "manager",
      "self": "/v2/managers/795",
      "id": 795,
      "created_date": "2018-10-27 15:43:07",
      "last_accessed": null,
      "name": "Example Manager",
      "email": "example@mycompany.com",
      "notes": "",
      "position": "Assistant to Ad Ops",
      "can_manage_links": false,
      "can_manage_media": false,
      "can_manage_targets": true,
      "can_manage_users": false,
      "publisher_access": "specific",
      "publisher_access_list": [
        1625,
        1645
      ],
      "statistics_access": "specific"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation manager_list

Create a Manager

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/managers \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"password":"VeRy_SeCuRe_PaSsWoRd","name":"Example Manager","email":"example@mycompany.com","notes":"","position":"Assistant to Ad Ops","can_manage_links":false,"can_manage_media":false,"can_manage_targets":true,"can_manage_users":false,"publisher_access":"specific","publisher_access_list":[1625,1645],"statistics_access":"specific"}'
var data = JSON.stringify({
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
});

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/managers");
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/managers")

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 = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/v2/managers", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/managers")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/managers"

	payload := strings.NewReader("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}")

	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 /managers

Body parameter

{
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
}

Parameters

Name In Type Required Description
body body manager_post false none
» name body string true Name of the manager.
» email body string true A valid email to allow the manager to access their account.
» notes body string false Aditional notes or information about the manager.
» position body string false Position of the manager in the organization.
» can_manage_links body boolean false Whether to allow managing hypermedia links.
» can_manage_media body boolean false Whether to allow managing various media.
» can_manage_targets body boolean false Whether to allow this user to managing various ad targeting features.
» can_manage_users body boolean false Whether to allow managing other manager accounts.
» publisher_access body string false Whether to allow access to some or all of the publishers. The three options for publisher access are:

  • "none": no publisher access granted.
  • "specific": manager can only access the publisher listed in the publisher access list. If "specific" is selected, publisher_access_list is a mandatory field.
  • "all": manager has access to all publishers in the AdButler account.

Managers that are given access to publishers can update publisher information, add/assign new advertiserments, and delete/unassign existing advertisements.

» publisher_access_list body [any] false The list of publishers this manager has been granted access to. This field is required if publisher_access has been set to "specific".
» statistics_access body string false Whether to allow viewing statistics. The three options are:

  • "none": no statistics visible.
  • "specific": only allow manager to see statistics of assigned publishers. All advertiser statistics will be visible.
  • "all": all publisher and advertiser statistics will be visible.
» password body string false The password used by the manager to sign in to AdButler. The given password must be 8 or more characters. If left blank, a random password will be generated. This field will never be returned in any responses.

Example responses

default Response

{
  "object": "manager",
  "self": "/v2/managers/795",
  "id": 795,
  "created_date": "2018-10-27 15:43:07",
  "last_accessed": null,
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
}

Responses

Status Meaning Description Schema
default Default successful operation manager_get

Get a Single Manager

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/managers/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/managers/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/managers/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/managers/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/managers/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/managers/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 /managers/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the manager you'd like to get.

Example responses

default Response

{
  "object": "manager",
  "self": "/v2/managers/795",
  "id": 795,
  "created_date": "2018-10-27 15:43:07",
  "last_accessed": null,
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
}

Responses

Status Meaning Description Schema
default Default successful operation manager_get

Update a Manager

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/managers/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"password":"VeRy_SeCuRe_PaSsWoRd","name":"Example Manager","email":"example@mycompany.com","notes":"","position":"Assistant to Ad Ops","can_manage_links":false,"can_manage_media":false,"can_manage_targets":true,"can_manage_users":false,"publisher_access":"specific","publisher_access_list":[1625,1645],"statistics_access":"specific"}'
var data = JSON.stringify({
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
});

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/managers/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/managers/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 = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/managers/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/managers/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/managers/0"

	payload := strings.NewReader("{\"password\":\"VeRy_SeCuRe_PaSsWoRd\",\"name\":\"Example Manager\",\"email\":\"example@mycompany.com\",\"notes\":\"\",\"position\":\"Assistant to Ad Ops\",\"can_manage_links\":false,\"can_manage_media\":false,\"can_manage_targets\":true,\"can_manage_users\":false,\"publisher_access\":\"specific\",\"publisher_access_list\":[1625,1645],\"statistics_access\":\"specific\"}")

	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 /managers/{id}

Body parameter

{
  "password": "VeRy_SeCuRe_PaSsWoRd",
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the manager you'd like to update.
body body manager_put false none
» name body string false Name of the manager.
» email body string false A valid email to allow the manager to access their account.
» notes body string false Aditional notes or information about the manager.
» position body string false Position of the manager in the organization.
» can_manage_links body boolean false Whether to allow managing hypermedia links.
» can_manage_media body boolean false Whether to allow managing various media.
» can_manage_targets body boolean false Whether to allow this user to managing various ad targeting features.
» can_manage_users body boolean false Whether to allow managing other manager accounts.
» publisher_access body string false Whether to allow access to some or all of the publishers. The three options for publisher access are:

  • "none": no publisher access granted.
  • "specific": manager can only access the publisher listed in the publisher access list. If "specific" is selected, publisher_access_list is a mandatory field.
  • "all": manager has access to all publishers in the AdButler account.

Managers that are given access to publishers can update publisher information, add/assign new advertiserments, and delete/unassign existing advertisements.

» publisher_access_list body [any] false The list of publishers this manager has been granted access to. This field is required if publisher_access has been set to "specific".
» statistics_access body string false Whether to allow viewing statistics. The three options are:

  • "none": no statistics visible.
  • "specific": only allow manager to see statistics of assigned publishers. All advertiser statistics will be visible.
  • "all": all publisher and advertiser statistics will be visible.
» password body string false The password used by the manager to sign in to AdButler. The given password must be 8 or more characters. If left blank, a random password will be generated. This field will never be returned in any responses.

Example responses

default Response

{
  "object": "manager",
  "self": "/v2/managers/795",
  "id": 795,
  "created_date": "2018-10-27 15:43:07",
  "last_accessed": null,
  "name": "Example Manager",
  "email": "example@mycompany.com",
  "notes": "",
  "position": "Assistant to Ad Ops",
  "can_manage_links": false,
  "can_manage_media": false,
  "can_manage_targets": true,
  "can_manage_users": false,
  "publisher_access": "specific",
  "publisher_access_list": [
    1625,
    1645
  ],
  "statistics_access": "specific"
}

Responses

Status Meaning Description Schema
default Default successful operation manager_get

Delete a Manager

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/managers/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/managers/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/managers/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/managers/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/managers/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/managers/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 /managers/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the manager you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Manual Tracking Links

Manual Tracking Links can be used to count clicks and impressions on your ad items and campaigns without having to make a new ad request. These are great when you want to track native ads, or serve cached creatives. There are a couple of options for click tracking as well. Depending on which click tracking link you generate, you can choose whether to redirect after the click is recorded or not.

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/manual-tracking-links \
  --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/manual-tracking-links");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/manual-tracking-links")

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/manual-tracking-links", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/manual-tracking-links")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/manual-tracking-links"

	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 /manual-tracking-links

Name In Type Required Description
placement path integer true The placement ID which contains the ad item that you want tracking links for.
ad_item path integer false The ID of the ad item that you want tracking links for. ad_item is a required field if the desired ad item is in a campaign.
type path string false Specifies the type of tracking links to generate and can be any of the following values: "impression", "click_redirect", "click_callback". You can specify multiple values by separating them with a comma (e.g. type="impression,click_callback"). Omitting type will return all of them in the response.
protocol path string false Whether to use http or https protocol for your tracking links. Accepted values are "http" or "https".

Example responses

default Response

{
  "object": "manual_tracking_links",
  "self": "/v2/manual-tracking-links",
  "data": {
    "impression": "servedbyadbutler.com/impression_url",
    "click_redirect": "servedbyadbutler.com/click_redirect_url",
    "click_callback": "servedbyadbutler.com/click_callback_url"
  }
}
Status Meaning Description Schema
default Default successful operation manual_tracking_link_get

Media Groups

Media groups allow you to group creatives together for easier organization and management in your account.

Get a List of Media Groups

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/media-groups \
  --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/media-groups");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/media-groups")

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/media-groups", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/media-groups")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/media-groups"

	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 /media-groups

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

{
  "url": "/v2/media-groups",
  "data": [
    {
      "object": "media_group",
      "id": 1285,
      "self": "/v2/media-groups/1285",
      "name": "My First Media Group"
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation media_group_list

Create a Media Group

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/media-groups \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"My First Media Group"}'
var data = JSON.stringify({
  "name": "My First Media Group"
});

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/media-groups");
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/media-groups")

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 First Media Group\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"My First Media Group\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/v2/media-groups", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/media-groups")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"My First Media Group\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/media-groups"

	payload := strings.NewReader("{\"name\":\"My First Media Group\"}")

	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 /media-groups

Body parameter

{
  "name": "My First Media Group"
}

Parameters

Name In Type Required Description
body body media_group_post false none
» name body string true The name of the media group.

Example responses

default Response

{
  "object": "media_group",
  "id": 1285,
  "self": "/v2/media-groups/1285",
  "name": "My First Media Group"
}

Responses

Status Meaning Description Schema
default Default successful operation media_group_get

Get a Single Media Group

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/media-groups/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/media-groups/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/media-groups/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/media-groups/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/media-groups/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/media-groups/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 /media-groups/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the media_group you'd like to get.

Example responses

default Response

{
  "object": "media_group",
  "id": 1285,
  "self": "/v2/media-groups/1285",
  "name": "My First Media Group"
}

Responses

Status Meaning Description Schema
default Default successful operation media_group_get

Update a Media Group

Code samples

curl --request PUT \
  --url https://api.adbutler.com/v2/media-groups/0 \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"name":"My First Media Group"}'
var data = JSON.stringify({
  "name": "My First Media Group"
});

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/media-groups/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/media-groups/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 First Media Group\"}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"name\":\"My First Media Group\"}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("PUT", "/v2/media-groups/0", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.put("https://api.adbutler.com/v2/media-groups/0")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"name\":\"My First Media Group\"}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/media-groups/0"

	payload := strings.NewReader("{\"name\":\"My First Media Group\"}")

	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 /media-groups/{id}

Body parameter

{
  "name": "My First Media Group"
}

Parameters

Name In Type Required Description
id path integer true Identifier of the media_group you'd like to update.
body body media_group_put false none
» name body string false The name of the media group.

Example responses

default Response

{
  "object": "media_group",
  "id": 1285,
  "self": "/v2/media-groups/1285",
  "name": "My First Media Group"
}

Responses

Status Meaning Description Schema
default Default successful operation media_group_get

Delete a Media Group

Code samples

curl --request DELETE \
  --url https://api.adbutler.com/v2/media-groups/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/media-groups/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/media-groups/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/media-groups/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.delete("https://api.adbutler.com/v2/media-groups/0")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/media-groups/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 /media-groups/{id}

Parameters

Name In Type Required Description
id path integer true Identifier of the media_group you'd like to delete.

Example responses

default Response

{
  "id": 1362,
  "deleted": true
}

Responses

Status Meaning Description Schema
default Default successful operation deleted

Placements

Assign an advertisement to a zone based on a set of scheduling criteria using the placements endpoint.

Each placement represents combination of criteria required to serve an advertisement. Prior to creating a placement, you will need to have created several other resources:

You may also optionally create targeting options, keywords, and activity limits to further control the deliverability of your placements.

Get a list of Placements

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/placements \
  --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/placements");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/placements")

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/placements", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/placements")
  .header("accept", "application/json")
  .asString();
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/placements"

	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 /placements

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

{
  "data": [
    {
      "created_date": "2019-04-17 16:31:02",
      "object": "placement",
      "self": "/v2/placements/1234",
      "id": 1234,
      "active": true,
      "advertisement": {
        "id": 222,
        "type": "standard_campaign"
      },
      "channel": null,
      "cost": {
        "cpm": 2.84,
        "cpc": 2.56,
        "cpa": 3.916
      },
      "day_cap_limit": null,
      "day_cap_type": "views",
      "geo_target": null,
      "isp_target": 555,
      "keywords": "example, keyword, list",
      "keywords_match_method": "preferred",
      "payout": {
        "type": "rate",
        "cpm": 1.6,
        "cpc": 1.75,
        "cpa": 2.3
      },
      "payout_percent": null,
      "per_user_view_limit": null,
      "per_user_view_period": null,
      "platform_target": null,
      "priority": "standard",
      "schedule": 888,
      "weight": 1,
      "zone": {
        "id": 999,
        "type": "standard_zone"
      }
    }
  ],
  "object": "list",
  "has_more": false,
  "limit": 10,
  "offset": 0
}

Responses

Status Meaning Description Schema
default Default successful operation placement_list

Create a Placement

Code samples

curl --request POST \
  --url https://api.adbutler.com/v2/placements \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"active":true,"advertisement":{"id":222,"type":"standard_campaign"},"channel":null,"cost":{"cpm":2.84,"cpc":2.56,"cpa":3.916},"day_cap_limit":null,"day_cap_type":"views","geo_target":null,"isp_target":555,"keywords":"example, keyword, list","keywords_match_method":"preferred","payout":{"type":"rate","cpm":1.6,"cpc":1.75,"cpa":2.3},"payout_percent":null,"per_user_view_limit":null,"per_user_view_period":null,"platform_target":null,"priority":"standard","schedule":888,"weight":1,"zone":{"id":999,"type":"standard_zone"}}'
var data = JSON.stringify({
  "active": true,
  "advertisement": {
    "id": 222,
    "type": "standard_campaign"
  },
  "channel": null,
  "cost": {
    "cpm": 2.84,
    "cpc": 2.56,
    "cpa": 3.916
  },
  "day_cap_limit": null,
  "day_cap_type": "views",
  "geo_target": null,
  "isp_target": 555,
  "keywords": "example, keyword, list",
  "keywords_match_method": "preferred",
  "payout": {
    "type": "rate",
    "cpm": 1.6,
    "cpc": 1.75,
    "cpa": 2.3
  },
  "payout_percent": null,
  "per_user_view_limit": null,
  "per_user_view_period": null,
  "platform_target": null,
  "priority": "standard",
  "schedule": 888,
  "weight": 1,
  "zone": {
    "id": 999,
    "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/placements");
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/placements")

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\":222,\"type\":\"standard_campaign\"},\"channel\":null,\"cost\":{\"cpm\":2.84,\"cpc\":2.56,\"cpa\":3.916},\"day_cap_limit\":null,\"day_cap_type\":\"views\",\"geo_target\":null,\"isp_target\":555,\"keywords\":\"example, keyword, list\",\"keywords_match_method\":\"preferred\",\"payout\":{\"type\":\"rate\",\"cpm\":1.6,\"cpc\":1.75,\"cpa\":2.3},\"payout_percent\":null,\"per_user_view_limit\":null,\"per_user_view_period\":null,\"platform_target\":null,\"priority\":\"standard\",\"schedule\":888,\"weight\":1,\"zone\":{\"id\":999,\"type\":\"standard_zone\"}}"

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.adbutler.com")

payload = "{\"active\":true,\"advertisement\":{\"id\":222,\"type\":\"standard_campaign\"},\"channel\":null,\"cost\":{\"cpm\":2.84,\"cpc\":2.56,\"cpa\":3.916},\"day_cap_limit\":null,\"day_cap_type\":\"views\",\"geo_target\":null,\"isp_target\":555,\"keywords\":\"example, keyword, list\",\"keywords_match_method\":\"preferred\",\"payout\":{\"type\":\"rate\",\"cpm\":1.6,\"cpc\":1.75,\"cpa\":2.3},\"payout_percent\":null,\"per_user_view_limit\":null,\"per_user_view_period\":null,\"platform_target\":null,\"priority\":\"standard\",\"schedule\":888,\"weight\":1,\"zone\":{\"id\":999,\"type\":\"standard_zone\"}}"

headers = {
    'content-type': "application/json",
    'accept': "application/json"
    }

conn.request("POST", "/v2/placements", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.post("https://api.adbutler.com/v2/placements")
  .header("content-type", "application/json")
  .header("accept", "application/json")
  .body("{\"active\":true,\"advertisement\":{\"id\":222,\"type\":\"standard_campaign\"},\"channel\":null,\"cost\":{\"cpm\":2.84,\"cpc\":2.56,\"cpa\":3.916},\"day_cap_limit\":null,\"day_cap_type\":\"views\",\"geo_target\":null,\"isp_target\":555,\"keywords\":\"example, keyword, list\",\"keywords_match_method\":\"preferred\",\"payout\":{\"type\":\"rate\",\"cpm\":1.6,\"cpc\":1.75,\"cpa\":2.3},\"payout_percent\":null,\"per_user_view_limit\":null,\"per_user_view_period\":null,\"platform_target\":null,\"priority\":\"standard\",\"schedule\":888,\"weight\":1,\"zone\":{\"id\":999,\"type\":\"standard_zone\"}}")
  .asString();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.adbutler.com/v2/placements"

	payload := strings.NewReader("{\"active\":true,\"advertisement\":{\"id\":222,\"type\":\"standard_campaign\"},\"channel\":null,\"cost\":{\"cpm\":2.84,\"cpc\":2.56,\"cpa\":3.916},\"day_cap_limit\":null,\"day_cap_type\":\"views\",\"geo_target\":null,\"isp_target\":555,\"keywords\":\"example, keyword, list\",\"keywords_match_method\":\"preferred\",\"payout\":{\"type\":\"rate\",\"cpm\":1.6,\"cpc\":1.75,\"cpa\":2.3},\"payout_percent\":null,\"per_user_view_limit\":null,\"per_user_view_period\":null,\"platform_target\":null,\"priority\":\"standard\",\"schedule\":888,\"weight\":1,\"zone\":{\"id\":999,\"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 /placements

Body parameter

{
  "active": true,
  "advertisement": {
    "id": 222,
    "type": "standard_campaign"
  },
  "channel": null,
  "cost": {
    "cpm": 2.84,
    "cpc": 2.56,
    "cpa": 3.916
  },
  "day_cap_limit": null,
  "day_cap_type": "views",
  "geo_target": null,
  "isp_target": 555,
  "keywords": "example, keyword, list",
  "keywords_match_method": "preferred",
  "payout": {
    "type": "rate",
    "cpm": 1.6,
    "cpc": 1.75,
    "cpa": 2.3
  },
  "payout_percent": null,
  "per_user_view_limit": null,
  "per_user_view_period": null,
  "platform_target": null,
  "priority": "standard",
  "schedule": 888,
  "weight": 1,
  "zone": {
    "id": 999,
    "type": "standard_zone"
  }
}

Parameters

Name In Type Required Description
body body placement_post false none
» active body boolean false Whether to actively serve ads in the zones (true) or pause ad serving (false). Defaults to true.
» advertisement body placement_advertisement true An object containing image ad item, flash ad item, rich media ad item, custom HTML ad item, standard campaign, text campaign, image popup, flash popup, custom HTML popup, or text ad identifier (ID) and type.
»» id body integer true Identifier of the advertisement. (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", "s2s_ad_item", "standard_campaign", "text_campaign", "image_popup", "flash_popup", "custom_html_popup", "text_ad", and "bidder".
» channel body integer true If assiged to a channel, this is the channel ID. This field cannot be given if zone is given. Either zone or channel are required in a POST.
» cost body placement_cost false An object associating a pricing model with the performance of your ad item placement. This information will be used to calculate the revenue generated by your ad. You can either use a fixed cost or a rate-based pricing model for your ad placements. Fixed cost is tied to the amount of quota and is given as { 'fixed_cost': 0.00 } You can also use a rate-based pricing model by specifying cpm, cpc, and cpa values as { 'cpm': 0.00, 'cpc': 0.00, 'cpa': 0.00 }.

This field is considered a classic PUT, meaning that any properties not included in the cost field will be set to 0.00 regardless of whether the property already had a value.

»» fixed_cost body number(float) false The fixed cost of the placement, not influenced by impressions, clicks, or actions. This property cannot be given if cpm, cpc, or cpa are given. Values are rounded to the nearest 100th (two decimal places).
»» cpm body number(float) false Cost per thousand impressions. This property cannot be given if fixed_cost is given. Values are rounded to the nearest 1000th (three decimal places).
»» cpc body number(float) false Cost per click. This property cannot be given if fixed_cost is given. Values are rounded to the nearest 1000th (three decimal places).
»» cpa body number(float) false Cost per action. This property cannot be given if fixed_cost is given. Values are rounded to the nearest 1000th (three decimal places).
» day_cap_limit body integer false The number of times an ad will be shown in a day. This field has been moved to the schedule object and is now deprecated.
» day_cap_type body string false Whether day_cap_limit is imposed on the number of views or the number of clicks. This field has been moved to the schedule object and is now deprecated.
» 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.
» isp_target body integer false The ISP target identifier (ID).
» keywords body string false Specify words separated by commas to determine if this ad should be served if a match is found. Use asterisk "*" character to represent a wildcard in a keyword e.g. "paint*" would match paint, painter, painting, paints etc. You can also stop the ad from being served in presence of a specific word by prepending a negative sign (-) to the word. For example, "-paint" would stop the ad from being delivered if the word "paint" is used.
» keywords_match_method body string false Whether to serve the ad only if a match is found ("required") or increase the serving priority of an ad whenever a match is found ("preferred").
» payout body placement_payout false This information will be used to calculate the payout to the ad's publisher. Percentage-based payouts will be calculated based on the placement's cost values, whereas rate-based payouts are independent of the placement's cost. Any combination of the four properties (fixed, cpm, cpc, cpa) can be given; however, fixed payout will be ignored for rate-based payout if any of the other three cpx properties are set.

This field is considered a classic PUT, meaning that any properties not included in the payout field will be set to 0.00 regardless of whether the property already had a value.

»» type body string true The type of payout the publisher will recieve. Accepted values are "percent" or "rate". This field is required when specifying a payout.
»» fixed body number(float) false The fixed payout of the placement, not influenced by impressions, clicks, or actions. Values are rounded to the nearest 100th (two decimal places).
»» cpm body number(float) false Cost per impression. Values are rounded to the nearest 100th (two decimal places).
»» cpc body number(float) false Cost per click. Values are rounded to the nearest 100th (two decimal places).
»» cpa body number(float) false Cost per action. Values are rounded to the nearest 100th (two decimal places).
» payout_percent body integer false The percentage of the ad generated revenue paid out to the publisher.

DEPRICATED: This field has been expanded to the more detailed payout, though it may still be used as a simplified version. We encourage updating to use payout as payout_percent will likely be removed in later versions of the API.

» per_user_view_limit body integer false The number of times the ad will be shown to a particular user in a time period given by per_user_view_period. The null value indicates frequency capping is disabled. This field has been moved to the schedule object and is now deprecated.
» per_user_view_period body integer false The number of days after which the per_user_view_limit counter will start over. The null value indicates frequency capping is disabled. This field has been moved to the schedule object and is now deprecated.
» platform_target body integer false The platform target identifier (ID) if you intend to restrict delivery of your ads to a certain device or a platform. Defaults to null which means platform targeting is not in effect.
» 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"
» schedule body integer true The schedule identifier (ID).
» weight body integer false A number used to determine the serving frequency of an advertisement. This number is used to compute the probability of an ad being served in a particular zone. Defaults to 1 which means every ad has an equal chance of being served. For example, consider three ad items assigned to a zone with weights of 1, 4 and 5. The ratio works out to a corresponding probability of 10%, 40% and 50% chance of each ad item being served.
» zone body placement_zone true If assigned to a zone, this is an object containing type and the zone ID. This field cannot be given if channel is given. Either zone or channel are required in a POST.
»» id body integer true Identifier of the zone. (ID)
»» type body string true Type of zone. Accepted values: "standard_zone", "text_zone", and "email_zone".

Example responses

default Response

{
  "created_date": "2019-04-17 16:31:02",
  "object": "placement",
  "self": "/v2/placements/1234",
  "id": 1234,
  "active": true,
  "advertisement": {
    "id": 222,
    "type": "standard_campaign"
  },
  "channel": null,
  "cost": {
    "cpm": 2.84,
    "cpc": 2.56,
    "cpa": 3.916
  },
  "day_cap_limit": null,
  "day_cap_type": "views",
  "geo_target": null,
  "isp_target": 555,
  "keywords": "example, keyword, list",
  "keywords_match_method": "preferred",
  "payout": {
    "type": "rate",
    "cpm": 1.6,
    "cpc": 1.75,
    "cpa": 2.3
  },
  "payout_percent": null,
  "per_user_view_limit": null,
  "per_user_view_period": null,
  "platform_target": null,
  "priority": "standard",
  "schedule": 888,
  "weight": 1,
  "zone": {
    "id": 999,
    "type": "standard_zone"
  }
}

Responses

Status Meaning Description Schema
default Default successful operation placement_get

Get a Single Placement

Code samples

curl --request GET \
  --url https://api.adbutler.com/v2/placements/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/placements/0");
xhr.setRequestHeader("accept", "application/json");

xhr.send(data);
require 'uri'
require 'net/http'

url = URI("https://api.adbutler.com/v2/placements/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/placements/0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
HttpResponse response = Unirest.get("https://api.adbutler.com/v2/placements/0")
  .header("accept", "application/json")
  .asString();
<