Ad Stack
Update an ad stack
Replaces the whole ad stack: name, integration list and order, integration settings and global settings. A name left out is cleared. Queues a tag rebuild for every publisher with a config (ad unit) using the stack. Call GET /v1/integration?target=ad_stack to find available integrations, and GET /v1/integration/{id}/stack-schema for each integration’s fields. Stack values the form doesn’t own are kept for integrations still in the stack: values set through the mapping endpoints for auto-populated fields, and will-not-map marks unless a value is sent for that field. Values for integrations no longer in the stack are deleted.
PUT
/
v1
/
ad-stack
/
{id}
Update an ad stack
curl --request PUT \
--url https://api.tagdeliver.com/v1/ad-stack/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "GAM + Prebid",
"integration": [
{
"id": "1njcno",
"config": {}
},
{
"id": "1njclq",
"config": {
"placementId": "123456"
}
},
{
"id": "gjdhgk",
"config": {
"weight": 1
}
}
],
"global": [
{
"id": "5yc22",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
}
}
]
}
'import requests
url = "https://api.tagdeliver.com/v1/ad-stack/{id}"
payload = {
"name": "GAM + Prebid",
"integration": [
{
"id": "1njcno",
"config": {}
},
{
"id": "1njclq",
"config": { "placementId": "123456" }
},
{
"id": "gjdhgk",
"config": { "weight": 1 }
}
],
"global": [
{
"id": "5yc22",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'GAM + Prebid',
integration: [
{id: '1njcno', config: {}},
{id: '1njclq', config: {placementId: '123456'}},
{id: 'gjdhgk', config: {weight: 1}}
],
global: [{id: '5yc22', config: {bidderTimeout: 1000, priceGranularity: 'dense'}}]
})
};
fetch('https://api.tagdeliver.com/v1/ad-stack/{id}', 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://api.tagdeliver.com/v1/ad-stack/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'GAM + Prebid',
'integration' => [
[
'id' => '1njcno',
'config' => [
]
],
[
'id' => '1njclq',
'config' => [
'placementId' => '123456'
]
],
[
'id' => 'gjdhgk',
'config' => [
'weight' => 1
]
]
],
'global' => [
[
'id' => '5yc22',
'config' => [
'bidderTimeout' => 1000,
'priceGranularity' => 'dense'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.tagdeliver.com/v1/ad-stack/{id}"
payload := strings.NewReader("{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.tagdeliver.com/v1/ad-stack/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/ad-stack/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": {
"id": 338,
"name": "GAM + Prebid",
"use_count": 4,
"global": [
{
"id": "5yc22",
"type": "ad_demand",
"logo": "A",
"logo_dark": "A",
"platform_name": "Ad Demand",
"sub_type": "Global Settings",
"account_name": null,
"schema": "/v1/integration/5yc22/stack-schema",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
},
"valid": true
}
],
"integration": [
{
"id": "1njcno",
"type": "ad_server",
"logo": "https://cdn.example.com/assets/logo/gam.svg",
"logo_dark": "https://cdn.example.com/assets/logo/gam--dark.svg",
"platform_name": "Google Ad Manager",
"account_name": "Example Media",
"sub_type": "Ad server",
"schema": "/v1/integration/1njcno/stack-schema",
"config": {
"ad_unit": "✨ Auto-populated"
},
"status": 1,
"valid": true
}
]
},
"success": true
}{
"success": false,
"message": "Form errors found: date_range: The data should match one item from enum"
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"success": false,
"message": "Resource not found"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}Authorizations
Body
application/json
Was this page helpful?
⌘I
Update an ad stack
curl --request PUT \
--url https://api.tagdeliver.com/v1/ad-stack/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "GAM + Prebid",
"integration": [
{
"id": "1njcno",
"config": {}
},
{
"id": "1njclq",
"config": {
"placementId": "123456"
}
},
{
"id": "gjdhgk",
"config": {
"weight": 1
}
}
],
"global": [
{
"id": "5yc22",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
}
}
]
}
'import requests
url = "https://api.tagdeliver.com/v1/ad-stack/{id}"
payload = {
"name": "GAM + Prebid",
"integration": [
{
"id": "1njcno",
"config": {}
},
{
"id": "1njclq",
"config": { "placementId": "123456" }
},
{
"id": "gjdhgk",
"config": { "weight": 1 }
}
],
"global": [
{
"id": "5yc22",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'GAM + Prebid',
integration: [
{id: '1njcno', config: {}},
{id: '1njclq', config: {placementId: '123456'}},
{id: 'gjdhgk', config: {weight: 1}}
],
global: [{id: '5yc22', config: {bidderTimeout: 1000, priceGranularity: 'dense'}}]
})
};
fetch('https://api.tagdeliver.com/v1/ad-stack/{id}', 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://api.tagdeliver.com/v1/ad-stack/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'GAM + Prebid',
'integration' => [
[
'id' => '1njcno',
'config' => [
]
],
[
'id' => '1njclq',
'config' => [
'placementId' => '123456'
]
],
[
'id' => 'gjdhgk',
'config' => [
'weight' => 1
]
]
],
'global' => [
[
'id' => '5yc22',
'config' => [
'bidderTimeout' => 1000,
'priceGranularity' => 'dense'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.tagdeliver.com/v1/ad-stack/{id}"
payload := strings.NewReader("{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.tagdeliver.com/v1/ad-stack/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/ad-stack/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"GAM + Prebid\",\n \"integration\": [\n {\n \"id\": \"1njcno\",\n \"config\": {}\n },\n {\n \"id\": \"1njclq\",\n \"config\": {\n \"placementId\": \"123456\"\n }\n },\n {\n \"id\": \"gjdhgk\",\n \"config\": {\n \"weight\": 1\n }\n }\n ],\n \"global\": [\n {\n \"id\": \"5yc22\",\n \"config\": {\n \"bidderTimeout\": 1000,\n \"priceGranularity\": \"dense\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": {
"id": 338,
"name": "GAM + Prebid",
"use_count": 4,
"global": [
{
"id": "5yc22",
"type": "ad_demand",
"logo": "A",
"logo_dark": "A",
"platform_name": "Ad Demand",
"sub_type": "Global Settings",
"account_name": null,
"schema": "/v1/integration/5yc22/stack-schema",
"config": {
"bidderTimeout": 1000,
"priceGranularity": "dense"
},
"valid": true
}
],
"integration": [
{
"id": "1njcno",
"type": "ad_server",
"logo": "https://cdn.example.com/assets/logo/gam.svg",
"logo_dark": "https://cdn.example.com/assets/logo/gam--dark.svg",
"platform_name": "Google Ad Manager",
"account_name": "Example Media",
"sub_type": "Ad server",
"schema": "/v1/integration/1njcno/stack-schema",
"config": {
"ad_unit": "✨ Auto-populated"
},
"status": 1,
"valid": true
}
]
},
"success": true
}{
"success": false,
"message": "Form errors found: date_range: The data should match one item from enum"
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"success": false,
"message": "Resource not found"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}