Simulate
curl --request POST \
--url https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"revision": 1,
"policy": {
"name": "<string>",
"inherit_project": false,
"modes": [],
"formats": [],
"channel_id": "<string>",
"timezone": "UTC",
"origin_inventory_id": "<string>",
"strict_content": false,
"allow_unclassified": false,
"require_consent": false,
"strict_duration": false,
"deadline_ms": 1500,
"max_attempts": 1,
"currency": "USD",
"direct_priority": "free",
"pacing_fallback": "first",
"pacing_margin_pct": 0,
"destinations": [
{
"id": "<string>",
"connection_id": "<string>",
"ad_profile_id": "<string>",
"inventory_id": "<string>",
"modes": [],
"formats": [],
"commercial": "open",
"allow_unclassified": false,
"reciprocal_exclusion": false,
"enforces_duration": false,
"enforces_brand_safety": false,
"linear_fallback": false,
"vast_certified": false,
"vast_url": "<string>",
"vast_hosts": [
"<string>"
],
"openrtb": {
"bidder_id": "<string>",
"imp_tag": "<string>",
"floor_micros": 0,
"fee_bps": 0
},
"commitment_line_id": "<string>",
"initial_cpm_micros": 500000000,
"initial_fill_bps": 5000,
"currency": "<string>"
}
],
"levels": [
{
"id": "<string>",
"destinations": [
"<string>"
],
"weights": {},
"optimize": false,
"control_pct": 0
}
],
"rules": [
{
"id": "<string>",
"level_ids": [
"<string>"
],
"match": "all",
"conditions": [
{
"value": "<string>"
}
]
}
],
"publisher_blocks": [
{
"id": "<string>",
"match": "all",
"conditions": [
{
"value": "<string>"
}
]
}
],
"default_level_ids": [
"<string>"
],
"fallback_level_id": "<string>"
},
"opportunity_id": "<string>",
"recorded_opportunity_id": "<string>",
"asset_id": "<string>",
"asset_version": "<string>",
"cue_seconds": 43200,
"stream_id": "<string>",
"epoch": 1,
"break_id": "<string>",
"channel_id": "<string>",
"timestamp": 16251840000,
"duration_seconds": 300,
"slot": 0,
"platform": "<string>",
"consent": true
}
'import requests
url = "https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate"
payload = {
"revision": 1,
"policy": {
"name": "<string>",
"inherit_project": False,
"modes": [],
"formats": [],
"channel_id": "<string>",
"timezone": "UTC",
"origin_inventory_id": "<string>",
"strict_content": False,
"allow_unclassified": False,
"require_consent": False,
"strict_duration": False,
"deadline_ms": 1500,
"max_attempts": 1,
"currency": "USD",
"direct_priority": "free",
"pacing_fallback": "first",
"pacing_margin_pct": 0,
"destinations": [
{
"id": "<string>",
"connection_id": "<string>",
"ad_profile_id": "<string>",
"inventory_id": "<string>",
"modes": [],
"formats": [],
"commercial": "open",
"allow_unclassified": False,
"reciprocal_exclusion": False,
"enforces_duration": False,
"enforces_brand_safety": False,
"linear_fallback": False,
"vast_certified": False,
"vast_url": "<string>",
"vast_hosts": ["<string>"],
"openrtb": {
"bidder_id": "<string>",
"imp_tag": "<string>",
"floor_micros": 0,
"fee_bps": 0
},
"commitment_line_id": "<string>",
"initial_cpm_micros": 500000000,
"initial_fill_bps": 5000,
"currency": "<string>"
}
],
"levels": [
{
"id": "<string>",
"destinations": ["<string>"],
"weights": {},
"optimize": False,
"control_pct": 0
}
],
"rules": [
{
"id": "<string>",
"level_ids": ["<string>"],
"match": "all",
"conditions": [{ "value": "<string>" }]
}
],
"publisher_blocks": [
{
"id": "<string>",
"match": "all",
"conditions": [{ "value": "<string>" }]
}
],
"default_level_ids": ["<string>"],
"fallback_level_id": "<string>"
},
"opportunity_id": "<string>",
"recorded_opportunity_id": "<string>",
"asset_id": "<string>",
"asset_version": "<string>",
"cue_seconds": 43200,
"stream_id": "<string>",
"epoch": 1,
"break_id": "<string>",
"channel_id": "<string>",
"timestamp": 16251840000,
"duration_seconds": 300,
"slot": 0,
"platform": "<string>",
"consent": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
revision: 1,
policy: {
name: '<string>',
inherit_project: false,
modes: [],
formats: [],
channel_id: '<string>',
timezone: 'UTC',
origin_inventory_id: '<string>',
strict_content: false,
allow_unclassified: false,
require_consent: false,
strict_duration: false,
deadline_ms: 1500,
max_attempts: 1,
currency: 'USD',
direct_priority: 'free',
pacing_fallback: 'first',
pacing_margin_pct: 0,
destinations: [
{
id: '<string>',
connection_id: '<string>',
ad_profile_id: '<string>',
inventory_id: '<string>',
modes: [],
formats: [],
commercial: 'open',
allow_unclassified: false,
reciprocal_exclusion: false,
enforces_duration: false,
enforces_brand_safety: false,
linear_fallback: false,
vast_certified: false,
vast_url: '<string>',
vast_hosts: ['<string>'],
openrtb: {bidder_id: '<string>', imp_tag: '<string>', floor_micros: 0, fee_bps: 0},
commitment_line_id: '<string>',
initial_cpm_micros: 500000000,
initial_fill_bps: 5000,
currency: '<string>'
}
],
levels: [
{
id: '<string>',
destinations: ['<string>'],
weights: {},
optimize: false,
control_pct: 0
}
],
rules: [
{
id: '<string>',
level_ids: ['<string>'],
match: 'all',
conditions: [{value: '<string>'}]
}
],
publisher_blocks: [{id: '<string>', match: 'all', conditions: [{value: '<string>'}]}],
default_level_ids: ['<string>'],
fallback_level_id: '<string>'
},
opportunity_id: '<string>',
recorded_opportunity_id: '<string>',
asset_id: '<string>',
asset_version: '<string>',
cue_seconds: 43200,
stream_id: '<string>',
epoch: 1,
break_id: '<string>',
channel_id: '<string>',
timestamp: 16251840000,
duration_seconds: 300,
slot: 0,
platform: '<string>',
consent: true
})
};
fetch('https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate', 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://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'revision' => 1,
'policy' => [
'name' => '<string>',
'inherit_project' => false,
'modes' => [
],
'formats' => [
],
'channel_id' => '<string>',
'timezone' => 'UTC',
'origin_inventory_id' => '<string>',
'strict_content' => false,
'allow_unclassified' => false,
'require_consent' => false,
'strict_duration' => false,
'deadline_ms' => 1500,
'max_attempts' => 1,
'currency' => 'USD',
'direct_priority' => 'free',
'pacing_fallback' => 'first',
'pacing_margin_pct' => 0,
'destinations' => [
[
'id' => '<string>',
'connection_id' => '<string>',
'ad_profile_id' => '<string>',
'inventory_id' => '<string>',
'modes' => [
],
'formats' => [
],
'commercial' => 'open',
'allow_unclassified' => false,
'reciprocal_exclusion' => false,
'enforces_duration' => false,
'enforces_brand_safety' => false,
'linear_fallback' => false,
'vast_certified' => false,
'vast_url' => '<string>',
'vast_hosts' => [
'<string>'
],
'openrtb' => [
'bidder_id' => '<string>',
'imp_tag' => '<string>',
'floor_micros' => 0,
'fee_bps' => 0
],
'commitment_line_id' => '<string>',
'initial_cpm_micros' => 500000000,
'initial_fill_bps' => 5000,
'currency' => '<string>'
]
],
'levels' => [
[
'id' => '<string>',
'destinations' => [
'<string>'
],
'weights' => [
],
'optimize' => false,
'control_pct' => 0
]
],
'rules' => [
[
'id' => '<string>',
'level_ids' => [
'<string>'
],
'match' => 'all',
'conditions' => [
[
'value' => '<string>'
]
]
]
],
'publisher_blocks' => [
[
'id' => '<string>',
'match' => 'all',
'conditions' => [
[
'value' => '<string>'
]
]
]
],
'default_level_ids' => [
'<string>'
],
'fallback_level_id' => '<string>'
],
'opportunity_id' => '<string>',
'recorded_opportunity_id' => '<string>',
'asset_id' => '<string>',
'asset_version' => '<string>',
'cue_seconds' => 43200,
'stream_id' => '<string>',
'epoch' => 1,
'break_id' => '<string>',
'channel_id' => '<string>',
'timestamp' => 16251840000,
'duration_seconds' => 300,
'slot' => 0,
'platform' => '<string>',
'consent' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate"
payload := strings.NewReader("{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Simular uma decisão de roteamento
POST
/
v1
/
adrouter
/
routers
/
{router_id}
/
simulate
Simulate
curl --request POST \
--url https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"revision": 1,
"policy": {
"name": "<string>",
"inherit_project": false,
"modes": [],
"formats": [],
"channel_id": "<string>",
"timezone": "UTC",
"origin_inventory_id": "<string>",
"strict_content": false,
"allow_unclassified": false,
"require_consent": false,
"strict_duration": false,
"deadline_ms": 1500,
"max_attempts": 1,
"currency": "USD",
"direct_priority": "free",
"pacing_fallback": "first",
"pacing_margin_pct": 0,
"destinations": [
{
"id": "<string>",
"connection_id": "<string>",
"ad_profile_id": "<string>",
"inventory_id": "<string>",
"modes": [],
"formats": [],
"commercial": "open",
"allow_unclassified": false,
"reciprocal_exclusion": false,
"enforces_duration": false,
"enforces_brand_safety": false,
"linear_fallback": false,
"vast_certified": false,
"vast_url": "<string>",
"vast_hosts": [
"<string>"
],
"openrtb": {
"bidder_id": "<string>",
"imp_tag": "<string>",
"floor_micros": 0,
"fee_bps": 0
},
"commitment_line_id": "<string>",
"initial_cpm_micros": 500000000,
"initial_fill_bps": 5000,
"currency": "<string>"
}
],
"levels": [
{
"id": "<string>",
"destinations": [
"<string>"
],
"weights": {},
"optimize": false,
"control_pct": 0
}
],
"rules": [
{
"id": "<string>",
"level_ids": [
"<string>"
],
"match": "all",
"conditions": [
{
"value": "<string>"
}
]
}
],
"publisher_blocks": [
{
"id": "<string>",
"match": "all",
"conditions": [
{
"value": "<string>"
}
]
}
],
"default_level_ids": [
"<string>"
],
"fallback_level_id": "<string>"
},
"opportunity_id": "<string>",
"recorded_opportunity_id": "<string>",
"asset_id": "<string>",
"asset_version": "<string>",
"cue_seconds": 43200,
"stream_id": "<string>",
"epoch": 1,
"break_id": "<string>",
"channel_id": "<string>",
"timestamp": 16251840000,
"duration_seconds": 300,
"slot": 0,
"platform": "<string>",
"consent": true
}
'import requests
url = "https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate"
payload = {
"revision": 1,
"policy": {
"name": "<string>",
"inherit_project": False,
"modes": [],
"formats": [],
"channel_id": "<string>",
"timezone": "UTC",
"origin_inventory_id": "<string>",
"strict_content": False,
"allow_unclassified": False,
"require_consent": False,
"strict_duration": False,
"deadline_ms": 1500,
"max_attempts": 1,
"currency": "USD",
"direct_priority": "free",
"pacing_fallback": "first",
"pacing_margin_pct": 0,
"destinations": [
{
"id": "<string>",
"connection_id": "<string>",
"ad_profile_id": "<string>",
"inventory_id": "<string>",
"modes": [],
"formats": [],
"commercial": "open",
"allow_unclassified": False,
"reciprocal_exclusion": False,
"enforces_duration": False,
"enforces_brand_safety": False,
"linear_fallback": False,
"vast_certified": False,
"vast_url": "<string>",
"vast_hosts": ["<string>"],
"openrtb": {
"bidder_id": "<string>",
"imp_tag": "<string>",
"floor_micros": 0,
"fee_bps": 0
},
"commitment_line_id": "<string>",
"initial_cpm_micros": 500000000,
"initial_fill_bps": 5000,
"currency": "<string>"
}
],
"levels": [
{
"id": "<string>",
"destinations": ["<string>"],
"weights": {},
"optimize": False,
"control_pct": 0
}
],
"rules": [
{
"id": "<string>",
"level_ids": ["<string>"],
"match": "all",
"conditions": [{ "value": "<string>" }]
}
],
"publisher_blocks": [
{
"id": "<string>",
"match": "all",
"conditions": [{ "value": "<string>" }]
}
],
"default_level_ids": ["<string>"],
"fallback_level_id": "<string>"
},
"opportunity_id": "<string>",
"recorded_opportunity_id": "<string>",
"asset_id": "<string>",
"asset_version": "<string>",
"cue_seconds": 43200,
"stream_id": "<string>",
"epoch": 1,
"break_id": "<string>",
"channel_id": "<string>",
"timestamp": 16251840000,
"duration_seconds": 300,
"slot": 0,
"platform": "<string>",
"consent": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
revision: 1,
policy: {
name: '<string>',
inherit_project: false,
modes: [],
formats: [],
channel_id: '<string>',
timezone: 'UTC',
origin_inventory_id: '<string>',
strict_content: false,
allow_unclassified: false,
require_consent: false,
strict_duration: false,
deadline_ms: 1500,
max_attempts: 1,
currency: 'USD',
direct_priority: 'free',
pacing_fallback: 'first',
pacing_margin_pct: 0,
destinations: [
{
id: '<string>',
connection_id: '<string>',
ad_profile_id: '<string>',
inventory_id: '<string>',
modes: [],
formats: [],
commercial: 'open',
allow_unclassified: false,
reciprocal_exclusion: false,
enforces_duration: false,
enforces_brand_safety: false,
linear_fallback: false,
vast_certified: false,
vast_url: '<string>',
vast_hosts: ['<string>'],
openrtb: {bidder_id: '<string>', imp_tag: '<string>', floor_micros: 0, fee_bps: 0},
commitment_line_id: '<string>',
initial_cpm_micros: 500000000,
initial_fill_bps: 5000,
currency: '<string>'
}
],
levels: [
{
id: '<string>',
destinations: ['<string>'],
weights: {},
optimize: false,
control_pct: 0
}
],
rules: [
{
id: '<string>',
level_ids: ['<string>'],
match: 'all',
conditions: [{value: '<string>'}]
}
],
publisher_blocks: [{id: '<string>', match: 'all', conditions: [{value: '<string>'}]}],
default_level_ids: ['<string>'],
fallback_level_id: '<string>'
},
opportunity_id: '<string>',
recorded_opportunity_id: '<string>',
asset_id: '<string>',
asset_version: '<string>',
cue_seconds: 43200,
stream_id: '<string>',
epoch: 1,
break_id: '<string>',
channel_id: '<string>',
timestamp: 16251840000,
duration_seconds: 300,
slot: 0,
platform: '<string>',
consent: true
})
};
fetch('https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate', 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://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'revision' => 1,
'policy' => [
'name' => '<string>',
'inherit_project' => false,
'modes' => [
],
'formats' => [
],
'channel_id' => '<string>',
'timezone' => 'UTC',
'origin_inventory_id' => '<string>',
'strict_content' => false,
'allow_unclassified' => false,
'require_consent' => false,
'strict_duration' => false,
'deadline_ms' => 1500,
'max_attempts' => 1,
'currency' => 'USD',
'direct_priority' => 'free',
'pacing_fallback' => 'first',
'pacing_margin_pct' => 0,
'destinations' => [
[
'id' => '<string>',
'connection_id' => '<string>',
'ad_profile_id' => '<string>',
'inventory_id' => '<string>',
'modes' => [
],
'formats' => [
],
'commercial' => 'open',
'allow_unclassified' => false,
'reciprocal_exclusion' => false,
'enforces_duration' => false,
'enforces_brand_safety' => false,
'linear_fallback' => false,
'vast_certified' => false,
'vast_url' => '<string>',
'vast_hosts' => [
'<string>'
],
'openrtb' => [
'bidder_id' => '<string>',
'imp_tag' => '<string>',
'floor_micros' => 0,
'fee_bps' => 0
],
'commitment_line_id' => '<string>',
'initial_cpm_micros' => 500000000,
'initial_fill_bps' => 5000,
'currency' => '<string>'
]
],
'levels' => [
[
'id' => '<string>',
'destinations' => [
'<string>'
],
'weights' => [
],
'optimize' => false,
'control_pct' => 0
]
],
'rules' => [
[
'id' => '<string>',
'level_ids' => [
'<string>'
],
'match' => 'all',
'conditions' => [
[
'value' => '<string>'
]
]
]
],
'publisher_blocks' => [
[
'id' => '<string>',
'match' => 'all',
'conditions' => [
[
'value' => '<string>'
]
]
]
],
'default_level_ids' => [
'<string>'
],
'fallback_level_id' => '<string>'
],
'opportunity_id' => '<string>',
'recorded_opportunity_id' => '<string>',
'asset_id' => '<string>',
'asset_version' => '<string>',
'cue_seconds' => 43200,
'stream_id' => '<string>',
'epoch' => 1,
'break_id' => '<string>',
'channel_id' => '<string>',
'timestamp' => 16251840000,
'duration_seconds' => 300,
'slot' => 0,
'platform' => '<string>',
'consent' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate"
payload := strings.NewReader("{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.interactivelayers.com/v1/adrouter/routers/{router_id}/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": 1,\n \"policy\": {\n \"name\": \"<string>\",\n \"inherit_project\": false,\n \"modes\": [],\n \"formats\": [],\n \"channel_id\": \"<string>\",\n \"timezone\": \"UTC\",\n \"origin_inventory_id\": \"<string>\",\n \"strict_content\": false,\n \"allow_unclassified\": false,\n \"require_consent\": false,\n \"strict_duration\": false,\n \"deadline_ms\": 1500,\n \"max_attempts\": 1,\n \"currency\": \"USD\",\n \"direct_priority\": \"free\",\n \"pacing_fallback\": \"first\",\n \"pacing_margin_pct\": 0,\n \"destinations\": [\n {\n \"id\": \"<string>\",\n \"connection_id\": \"<string>\",\n \"ad_profile_id\": \"<string>\",\n \"inventory_id\": \"<string>\",\n \"modes\": [],\n \"formats\": [],\n \"commercial\": \"open\",\n \"allow_unclassified\": false,\n \"reciprocal_exclusion\": false,\n \"enforces_duration\": false,\n \"enforces_brand_safety\": false,\n \"linear_fallback\": false,\n \"vast_certified\": false,\n \"vast_url\": \"<string>\",\n \"vast_hosts\": [\n \"<string>\"\n ],\n \"openrtb\": {\n \"bidder_id\": \"<string>\",\n \"imp_tag\": \"<string>\",\n \"floor_micros\": 0,\n \"fee_bps\": 0\n },\n \"commitment_line_id\": \"<string>\",\n \"initial_cpm_micros\": 500000000,\n \"initial_fill_bps\": 5000,\n \"currency\": \"<string>\"\n }\n ],\n \"levels\": [\n {\n \"id\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"weights\": {},\n \"optimize\": false,\n \"control_pct\": 0\n }\n ],\n \"rules\": [\n {\n \"id\": \"<string>\",\n \"level_ids\": [\n \"<string>\"\n ],\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"publisher_blocks\": [\n {\n \"id\": \"<string>\",\n \"match\": \"all\",\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ],\n \"default_level_ids\": [\n \"<string>\"\n ],\n \"fallback_level_id\": \"<string>\"\n },\n \"opportunity_id\": \"<string>\",\n \"recorded_opportunity_id\": \"<string>\",\n \"asset_id\": \"<string>\",\n \"asset_version\": \"<string>\",\n \"cue_seconds\": 43200,\n \"stream_id\": \"<string>\",\n \"epoch\": 1,\n \"break_id\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"timestamp\": 16251840000,\n \"duration_seconds\": 300,\n \"slot\": 0,\n \"platform\": \"<string>\",\n \"consent\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Autorizações
Parâmetros de caminho
Corpo
application/json
Resposta
Successful Response