Cache Management
Update Placements
Stores placement information in the cache. Used to update serving logic based on placement metadata.
POST
/
api
/
cache
/
placements
Update Placements
curl --request POST \
--url https://your_a2_service/api/cache/placements \
--header 'Content-Type: application/json' \
--data '
[
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"display": {
"clktype": 1,
"instl": 0,
"priv": 0,
"unit": 2
},
"siteid": "<string>",
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
'import requests
url = "https://your_a2_service/api/cache/placements"
payload = [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"display": {
"clktype": 1,
"instl": 0,
"priv": 0,
"unit": 2
},
"siteid": "<string>",
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
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([
{
created_at: '2023-11-07T05:31:56Z',
id: '<string>',
display: {clktype: 1, instl: 0, priv: 0, unit: 2},
siteid: '<string>',
video: {
boxing: 1,
maxext: 0,
podseq: 0,
skipafter: 0,
skipmin: 0,
slotinpod: 0,
unit: 2
}
}
])
};
fetch('https://your_a2_service/api/cache/placements', 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/placements",
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([
[
'created_at' => '2023-11-07T05:31:56Z',
'id' => '<string>',
'display' => [
'clktype' => 1,
'instl' => 0,
'priv' => 0,
'unit' => 2
],
'siteid' => '<string>',
'video' => [
'boxing' => 1,
'maxext' => 0,
'podseq' => 0,
'skipafter' => 0,
'skipmin' => 0,
'slotinpod' => 0,
'unit' => 2
]
]
]),
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/placements"
payload := strings.NewReader("[\n {\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\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/placements")
.header("Content-Type", "application/json")
.body("[\n {\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/placements")
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 \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\n }\n }\n]"
response = http.request(request)
puts response.read_bodyBody
application/json
The date and time when the placement was created.
ID of the placement (uuid4) a.k.a tagid in internal system.
Placement Subtype Object that indicates that this may be a display placement and provides additional detail related thereto. Refer to Object: DisplayPlacement.
Show child attributes
Show child attributes
Additional placement-specific extensions. Defaults to the PlacementExt object.
Show child attributes
Show child attributes
(deprecated)
Placement Subtype Object that indicates that this may be a video placement and provides additional detail related thereto. Refer to Object: VideoPlacement.
Show child attributes
Show child attributes
Response
Success
Was this page helpful?
Previous
Delete Placements
Removes placement information from the cache.
Targets are identified by placement ID list in the request body.
Next
⌘I
Update Placements
curl --request POST \
--url https://your_a2_service/api/cache/placements \
--header 'Content-Type: application/json' \
--data '
[
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"display": {
"clktype": 1,
"instl": 0,
"priv": 0,
"unit": 2
},
"siteid": "<string>",
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
'import requests
url = "https://your_a2_service/api/cache/placements"
payload = [
{
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"display": {
"clktype": 1,
"instl": 0,
"priv": 0,
"unit": 2
},
"siteid": "<string>",
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
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([
{
created_at: '2023-11-07T05:31:56Z',
id: '<string>',
display: {clktype: 1, instl: 0, priv: 0, unit: 2},
siteid: '<string>',
video: {
boxing: 1,
maxext: 0,
podseq: 0,
skipafter: 0,
skipmin: 0,
slotinpod: 0,
unit: 2
}
}
])
};
fetch('https://your_a2_service/api/cache/placements', 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/placements",
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([
[
'created_at' => '2023-11-07T05:31:56Z',
'id' => '<string>',
'display' => [
'clktype' => 1,
'instl' => 0,
'priv' => 0,
'unit' => 2
],
'siteid' => '<string>',
'video' => [
'boxing' => 1,
'maxext' => 0,
'podseq' => 0,
'skipafter' => 0,
'skipmin' => 0,
'slotinpod' => 0,
'unit' => 2
]
]
]),
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/placements"
payload := strings.NewReader("[\n {\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\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/placements")
.header("Content-Type", "application/json")
.body("[\n {\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/placements")
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 \"created_at\": \"2023-11-07T05:31:56Z\",\n \"id\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"instl\": 0,\n \"priv\": 0,\n \"unit\": 2\n },\n \"siteid\": \"<string>\",\n \"video\": {\n \"boxing\": 1,\n \"maxext\": 0,\n \"podseq\": 0,\n \"skipafter\": 0,\n \"skipmin\": 0,\n \"slotinpod\": 0,\n \"unit\": 2\n }\n }\n]"
response = http.request(request)
puts response.read_body