Cache Management
Update Creatives
Stores creative information in the cache. Used to build ad responses during ad serving.
POST
/
app
/
api
/
cache
/
creatives
Update Creatives
curl --request POST \
--url https://your_a2_service/app/api/cache/creatives \
--header 'Content-Type: application/json' \
--data '
[
{
"height": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"width": 1,
"advertiser_domain": "<string>",
"advertiser_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ext": {},
"native": {
"asset": [
{
"id": 3,
"title": {
"text": "Sample Headline"
}
}
],
"link": {
"url": "https://example.com/click"
}
},
"start_date": "2023-11-07T05:31:56Z",
"status": "inactive",
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": []
}
}
]
'import requests
url = "https://your_a2_service/app/api/cache/creatives"
payload = [
{
"height": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"width": 1,
"advertiser_domain": "<string>",
"advertiser_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ext": {},
"native": {
"asset": [
{
"id": 3,
"title": { "text": "Sample Headline" }
}
],
"link": { "url": "https://example.com/click" }
},
"start_date": "2023-11-07T05:31:56Z",
"status": "inactive",
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": []
}
}
]
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([
{
height: 1,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
width: 1,
advertiser_domain: '<string>',
advertiser_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
banner: {ext: {}, img: '', link: {ext: {}, url: ''}},
description: '<string>',
end_date: '2023-11-07T05:31:56Z',
ext: {},
native: {
asset: [{id: 3, title: {text: 'Sample Headline'}}],
link: {url: 'https://example.com/click'}
},
start_date: '2023-11-07T05:31:56Z',
status: 'inactive',
video: {adm: '', ctype: 2, dur: 0, ext: {cdn: '', linear: 1, url: ''}, mime: []}
}
])
};
fetch('https://your_a2_service/app/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/app/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([
[
'height' => 1,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'width' => 1,
'advertiser_domain' => '<string>',
'advertiser_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'banner' => [
'ext' => [
],
'img' => '',
'link' => [
'ext' => [
],
'url' => ''
]
],
'description' => '<string>',
'end_date' => '2023-11-07T05:31:56Z',
'ext' => [
],
'native' => [
'asset' => [
[
'id' => 3,
'title' => [
'text' => 'Sample Headline'
]
]
],
'link' => [
'url' => 'https://example.com/click'
]
],
'start_date' => '2023-11-07T05:31:56Z',
'status' => 'inactive',
'video' => [
'adm' => '',
'ctype' => 2,
'dur' => 0,
'ext' => [
'cdn' => '',
'linear' => 1,
'url' => ''
],
'mime' => [
]
]
]
]),
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/app/api/cache/creatives"
payload := strings.NewReader("[\n {\n \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\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/app/api/cache/creatives")
.header("Content-Type", "application/json")
.body("[\n {\n \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/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 \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\n }\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Body
application/json
Height of the creative in pixels.
Required range:
x >= 0Unique identifier for the creative (UUID v7).
Human-readable name of the creative.
User ID of the admin/operator who created the creative.
Type of the creative (e.g., "banner", "video", "native").
Available options:
banner, video, native Width of the creative in pixels.
Required range:
x >= 0Advertiser domain using this creative.
Advertiser ID using this creative.
Banner creative content.
Show child attributes
Show child attributes
Example:
{
"ext": {},
"img": "",
"link": { "ext": {}, "url": "" }
}
Optional description of the creative.
extension for the creative
Native creative content
Show child attributes
Show child attributes
Example:
{
"asset": [
{
"id": 3,
"title": { "text": "Sample Headline" }
}
],
"link": { "url": "https://example.com/click" }
}
Status of the creative.
Available options:
inactive, active Video creative content.
Show child attributes
Show child attributes
Example:
{
"adm": "",
"ctype": 2,
"dur": 0,
"ext": { "cdn": "", "linear": 1, "url": "" },
"mime": []
}
Response
Success
Was this page helpful?
⌘I
Update Creatives
curl --request POST \
--url https://your_a2_service/app/api/cache/creatives \
--header 'Content-Type: application/json' \
--data '
[
{
"height": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"width": 1,
"advertiser_domain": "<string>",
"advertiser_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ext": {},
"native": {
"asset": [
{
"id": 3,
"title": {
"text": "Sample Headline"
}
}
],
"link": {
"url": "https://example.com/click"
}
},
"start_date": "2023-11-07T05:31:56Z",
"status": "inactive",
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": []
}
}
]
'import requests
url = "https://your_a2_service/app/api/cache/creatives"
payload = [
{
"height": 1,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"width": 1,
"advertiser_domain": "<string>",
"advertiser_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"banner": {
"ext": {},
"img": "",
"link": {
"ext": {},
"url": ""
}
},
"description": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"ext": {},
"native": {
"asset": [
{
"id": 3,
"title": { "text": "Sample Headline" }
}
],
"link": { "url": "https://example.com/click" }
},
"start_date": "2023-11-07T05:31:56Z",
"status": "inactive",
"video": {
"adm": "",
"ctype": 2,
"dur": 0,
"ext": {
"cdn": "",
"linear": 1,
"url": ""
},
"mime": []
}
}
]
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([
{
height: 1,
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
width: 1,
advertiser_domain: '<string>',
advertiser_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
banner: {ext: {}, img: '', link: {ext: {}, url: ''}},
description: '<string>',
end_date: '2023-11-07T05:31:56Z',
ext: {},
native: {
asset: [{id: 3, title: {text: 'Sample Headline'}}],
link: {url: 'https://example.com/click'}
},
start_date: '2023-11-07T05:31:56Z',
status: 'inactive',
video: {adm: '', ctype: 2, dur: 0, ext: {cdn: '', linear: 1, url: ''}, mime: []}
}
])
};
fetch('https://your_a2_service/app/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/app/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([
[
'height' => 1,
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'width' => 1,
'advertiser_domain' => '<string>',
'advertiser_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'banner' => [
'ext' => [
],
'img' => '',
'link' => [
'ext' => [
],
'url' => ''
]
],
'description' => '<string>',
'end_date' => '2023-11-07T05:31:56Z',
'ext' => [
],
'native' => [
'asset' => [
[
'id' => 3,
'title' => [
'text' => 'Sample Headline'
]
]
],
'link' => [
'url' => 'https://example.com/click'
]
],
'start_date' => '2023-11-07T05:31:56Z',
'status' => 'inactive',
'video' => [
'adm' => '',
'ctype' => 2,
'dur' => 0,
'ext' => [
'cdn' => '',
'linear' => 1,
'url' => ''
],
'mime' => [
]
]
]
]),
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/app/api/cache/creatives"
payload := strings.NewReader("[\n {\n \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\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/app/api/cache/creatives")
.header("Content-Type", "application/json")
.body("[\n {\n \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/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 \"height\": 1,\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"width\": 1,\n \"advertiser_domain\": \"<string>\",\n \"advertiser_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"banner\": {\n \"ext\": {},\n \"img\": \"\",\n \"link\": {\n \"ext\": {},\n \"url\": \"\"\n }\n },\n \"description\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"ext\": {},\n \"native\": {\n \"asset\": [\n {\n \"id\": 3,\n \"title\": {\n \"text\": \"Sample Headline\"\n }\n }\n ],\n \"link\": {\n \"url\": \"https://example.com/click\"\n }\n },\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"inactive\",\n \"video\": {\n \"adm\": \"\",\n \"ctype\": 2,\n \"dur\": 0,\n \"ext\": {\n \"cdn\": \"\",\n \"linear\": 1,\n \"url\": \"\"\n },\n \"mime\": []\n }\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"