Update Creatives
Stores creative information in the cache. Used to build ad responses during ad serving.
curl --request POST \
--url https://your_a2_service/api/cache/creatives \
--header 'Content-Type: application/json' \
--data '
[
{
"cid": "<string>",
"height": 1,
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"status": "<string>",
"type": "<string>",
"width": 1,
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"native": {
"ext": {},
"link": {
"ext": {},
"url": ""
}
},
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": [
"video/mp4"
]
}
}
]
'import requests
url = "https://your_a2_service/api/cache/creatives"
payload = [
{
"cid": "<string>",
"height": 1,
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"status": "<string>",
"type": "<string>",
"width": 1,
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"native": {
"ext": {},
"link": {
"ext": {},
"url": ""
}
},
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": ["video/mp4"]
}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
cid: '<string>',
height: 1,
id: '<string>',
name: '<string>',
owner_id: '<string>',
status: '<string>',
type: '<string>',
width: 1,
banner: {ext: {}, img: '', link: {ext: {}, url: ''}},
description: '<string>',
native: {ext: {}, link: {ext: {}, url: ''}},
video: {
adm: '',
ctype: 2,
dur: 0,
ext: {cdn: '', linear: 1, url: ''},
mime: ['video/mp4']
}
}
])
};
fetch('https://your_a2_service/api/cache/creatives', 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://your_a2_service/api/cache/creatives",
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([
[
'cid' => '<string>',
'height' => 1,
'id' => '<string>',
'name' => '<string>',
'owner_id' => '<string>',
'status' => '<string>',
'type' => '<string>',
'width' => 1,
'banner' => [
'ext' => [
],
'img' => '',
'link' => [
'ext' => [
],
'url' => ''
]
],
'description' => '<string>',
'native' => [
'ext' => [
],
'link' => [
'ext' => [
],
'url' => ''
]
],
'video' => [
'adm' => '',
'ctype' => 2,
'dur' => 0,
'ext' => [
'cdn' => '',
'linear' => 1,
'url' => ''
],
'mime' => [
'video/mp4'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://your_a2_service/api/cache/creatives"
payload := strings.NewReader("[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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://your_a2_service/api/cache/creatives")
.header("Content-Type", "application/json")
.body("[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/creatives")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]"
response = http.request(request)
puts response.read_bodyBody
Campaign ID this creative belongs to.
Height of the creative in pixels.
x >= 0Unique identifier for the creative (UUID v4).
Human-readable name of the creative.
Owner ID of the creative (e.g., advertiser or account owner).
Status of the creative (e.g., "active", "inactive").
Type of the creative (e.g., "banner", "video", "native"). Refer to: a2_adm/db/models/creative.py:Creative
Width of the creative in pixels.
x >= 0Banner creative content (custom format). Note: This format is not identical to OpenRTB's banner object.
Optional description of the creative.
Native creative content (custom format). Note: This format is not identical to OpenRTB's native object.
Video creative content (custom format). Note: This format is not identical to OpenRTB's video object.
Show child attributes
Show child attributes
Response
Success
Was this page helpful?
curl --request POST \
--url https://your_a2_service/api/cache/creatives \
--header 'Content-Type: application/json' \
--data '
[
{
"cid": "<string>",
"height": 1,
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"status": "<string>",
"type": "<string>",
"width": 1,
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"native": {
"ext": {},
"link": {
"ext": {},
"url": ""
}
},
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": [
"video/mp4"
]
}
}
]
'import requests
url = "https://your_a2_service/api/cache/creatives"
payload = [
{
"cid": "<string>",
"height": 1,
"id": "<string>",
"name": "<string>",
"owner_id": "<string>",
"status": "<string>",
"type": "<string>",
"width": 1,
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"native": {
"ext": {},
"link": {
"ext": {},
"url": ""
}
},
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": ["video/mp4"]
}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
cid: '<string>',
height: 1,
id: '<string>',
name: '<string>',
owner_id: '<string>',
status: '<string>',
type: '<string>',
width: 1,
banner: {ext: {}, img: '', link: {ext: {}, url: ''}},
description: '<string>',
native: {ext: {}, link: {ext: {}, url: ''}},
video: {
adm: '',
ctype: 2,
dur: 0,
ext: {cdn: '', linear: 1, url: ''},
mime: ['video/mp4']
}
}
])
};
fetch('https://your_a2_service/api/cache/creatives', 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://your_a2_service/api/cache/creatives",
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([
[
'cid' => '<string>',
'height' => 1,
'id' => '<string>',
'name' => '<string>',
'owner_id' => '<string>',
'status' => '<string>',
'type' => '<string>',
'width' => 1,
'banner' => [
'ext' => [
],
'img' => '',
'link' => [
'ext' => [
],
'url' => ''
]
],
'description' => '<string>',
'native' => [
'ext' => [
],
'link' => [
'ext' => [
],
'url' => ''
]
],
'video' => [
'adm' => '',
'ctype' => 2,
'dur' => 0,
'ext' => [
'cdn' => '',
'linear' => 1,
'url' => ''
],
'mime' => [
'video/mp4'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"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://your_a2_service/api/cache/creatives"
payload := strings.NewReader("[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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://your_a2_service/api/cache/creatives")
.header("Content-Type", "application/json")
.body("[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/creatives")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"cid\": \"<string>\",\n \"height\": 1,\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"owner_id\": \"<string>\",\n \"status\": \"<string>\",\n \"type\": \"<string>\",\n \"width\": 1,\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"native\": {\n \"ext\": {},\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": [\n \"video/mp4\"\n ]\n }\n }\n]"
response = http.request(request)
puts response.read_body