Get publisher platforms
curl --request GET \
--url https://{publisher_host}/v1/publisher-platforms \
--header 'Authorization: Bearer <token>'import requests
url = "https://{publisher_host}/v1/publisher-platforms"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{publisher_host}/v1/publisher-platforms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{publisher_host}/v1/publisher-platforms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{publisher_host}/v1/publisher-platforms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{publisher_host}/v1/publisher-platforms")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{publisher_host}/v1/publisher-platforms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"publisher_platforms": [
{
"id": "drammens_tidende",
"name": "Drammens Tidende",
"formats": [
"image",
"video"
]
}
]
}Platforms
Get publisher platforms
List the channels Targeter may request when creating or updating an ad
GET
/
publisher-platforms
Get publisher platforms
curl --request GET \
--url https://{publisher_host}/v1/publisher-platforms \
--header 'Authorization: Bearer <token>'import requests
url = "https://{publisher_host}/v1/publisher-platforms"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{publisher_host}/v1/publisher-platforms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{publisher_host}/v1/publisher-platforms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{publisher_host}/v1/publisher-platforms"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{publisher_host}/v1/publisher-platforms")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{publisher_host}/v1/publisher-platforms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"publisher_platforms": [
{
"id": "drammens_tidende",
"name": "Drammens Tidende",
"formats": [
"image",
"video"
]
}
]
}Overview
Return the publisher channels Targeter is allowed to pass inpublisher_platforms on Create ad and Update ad.
id must be stable. Targeter stores these ids and sends them back unchanged. formats tells Targeter which creative types (image, video, html5) each channel accepts.
Request
Headers
Authorization: Bearer {token}(required)
Example Request
curl "https://publisher.example.com/v1/publisher-platforms" \
-H "Authorization: Bearer YOUR_TOKEN"
Response
Success (200)
object[]
Channels available for delivery
string
Stable platform id to pass when creating an ad
string
Human-readable platform name
string[]
Creative formats this platform accepts:
image, video, and/or html5{
"publisher_platforms": [
{
"id": "drammens_tidende",
"name": "Drammens Tidende",
"formats": ["image", "video", "html5"]
},
{
"id": "nettavisen",
"name": "Nettavisen",
"formats": ["image", "video", "html5"]
},
{
"id": "romerikes_blad",
"name": "Romerikes Blad",
"formats": ["image", "video", "html5"]
}
]
}
Error Responses
401 - Unauthorized
{
"error": "Missing or invalid Authorization header"
}
500 - Server Error
{
"error": "Unexpected server error. Please try again later."
}