Cache Management
Update Allocations
Stores allocation information between ad_units and line_items. Used to determine eligible line_items during mediation.
POST
/
app
/
api
/
cache
/
allocations
Update Allocations
curl --request POST \
--url https://your_a2_service/app/api/cache/allocations \
--header 'Content-Type: application/json' \
--data '
[
{
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ext": {
"ad_log_tracking_mode": "on_ad_response",
"deferred_native_rendering": false,
"deferred_native_template": "",
"frequency_capping": {
"enabled": 0,
"limit_multiple_click": 0,
"limit_user_impression": [
{
"limit_count": 0,
"num_time_units": 0,
"time_unit": "day"
}
]
},
"supported_environments": [
"web",
"app"
]
},
"last_comment": "",
"no": 0,
"status": "pending"
}
]
'import requests
url = "https://your_a2_service/app/api/cache/allocations"
payload = [
{
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ext": {
"ad_log_tracking_mode": "on_ad_response",
"deferred_native_rendering": False,
"deferred_native_template": "",
"frequency_capping": {
"enabled": 0,
"limit_multiple_click": 0,
"limit_user_impression": [
{
"limit_count": 0,
"num_time_units": 0,
"time_unit": "day"
}
]
},
"supported_environments": ["web", "app"]
},
"last_comment": "",
"no": 0,
"status": "pending"
}
]
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([
{
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ext: {
ad_log_tracking_mode: 'on_ad_response',
deferred_native_rendering: false,
deferred_native_template: '',
frequency_capping: {
enabled: 0,
limit_multiple_click: 0,
limit_user_impression: [{limit_count: 0, num_time_units: 0, time_unit: 'day'}]
},
supported_environments: ['web', 'app']
},
last_comment: '',
no: 0,
status: 'pending'
}
])
};
fetch('https://your_a2_service/app/api/cache/allocations', 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/allocations",
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([
[
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ext' => [
'ad_log_tracking_mode' => 'on_ad_response',
'deferred_native_rendering' => false,
'deferred_native_template' => '',
'frequency_capping' => [
'enabled' => 0,
'limit_multiple_click' => 0,
'limit_user_impression' => [
[
'limit_count' => 0,
'num_time_units' => 0,
'time_unit' => 'day'
]
]
],
'supported_environments' => [
'web',
'app'
]
],
'last_comment' => '',
'no' => 0,
'status' => 'pending'
]
]),
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/allocations"
payload := strings.NewReader("[\n {\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\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/allocations")
.header("Content-Type", "application/json")
.body("[\n {\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/api/cache/allocations")
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 \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"Body
application/json
Owner ID
Resource ID (line_items.id or recommendation_policies.id)
Resource type allocated to the target (line_item / recommendation_policy)
Available options:
line_item, recommendation_policy Target ID (ad_units.id or placements.id)
Target type (ad_unit / placement)
Available options:
ad_unit, placement for various configuration
Show child attributes
Show child attributes
Last comment
ID of the allocation
The current status of the allocation (e.g. pending, published, rejected)
Available options:
pending, requested, published, rejected, canceled, finished Response
Success
Was this page helpful?
⌘I
Update Allocations
curl --request POST \
--url https://your_a2_service/app/api/cache/allocations \
--header 'Content-Type: application/json' \
--data '
[
{
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ext": {
"ad_log_tracking_mode": "on_ad_response",
"deferred_native_rendering": false,
"deferred_native_template": "",
"frequency_capping": {
"enabled": 0,
"limit_multiple_click": 0,
"limit_user_impression": [
{
"limit_count": 0,
"num_time_units": 0,
"time_unit": "day"
}
]
},
"supported_environments": [
"web",
"app"
]
},
"last_comment": "",
"no": 0,
"status": "pending"
}
]
'import requests
url = "https://your_a2_service/app/api/cache/allocations"
payload = [
{
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ext": {
"ad_log_tracking_mode": "on_ad_response",
"deferred_native_rendering": False,
"deferred_native_template": "",
"frequency_capping": {
"enabled": 0,
"limit_multiple_click": 0,
"limit_user_impression": [
{
"limit_count": 0,
"num_time_units": 0,
"time_unit": "day"
}
]
},
"supported_environments": ["web", "app"]
},
"last_comment": "",
"no": 0,
"status": "pending"
}
]
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([
{
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ext: {
ad_log_tracking_mode: 'on_ad_response',
deferred_native_rendering: false,
deferred_native_template: '',
frequency_capping: {
enabled: 0,
limit_multiple_click: 0,
limit_user_impression: [{limit_count: 0, num_time_units: 0, time_unit: 'day'}]
},
supported_environments: ['web', 'app']
},
last_comment: '',
no: 0,
status: 'pending'
}
])
};
fetch('https://your_a2_service/app/api/cache/allocations', 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/allocations",
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([
[
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ext' => [
'ad_log_tracking_mode' => 'on_ad_response',
'deferred_native_rendering' => false,
'deferred_native_template' => '',
'frequency_capping' => [
'enabled' => 0,
'limit_multiple_click' => 0,
'limit_user_impression' => [
[
'limit_count' => 0,
'num_time_units' => 0,
'time_unit' => 'day'
]
]
],
'supported_environments' => [
'web',
'app'
]
],
'last_comment' => '',
'no' => 0,
'status' => 'pending'
]
]),
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/allocations"
payload := strings.NewReader("[\n {\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\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/allocations")
.header("Content-Type", "application/json")
.body("[\n {\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/api/cache/allocations")
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 \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ext\": {\n \"ad_log_tracking_mode\": \"on_ad_response\",\n \"deferred_native_rendering\": false,\n \"deferred_native_template\": \"\",\n \"frequency_capping\": {\n \"enabled\": 0,\n \"limit_multiple_click\": 0,\n \"limit_user_impression\": [\n {\n \"limit_count\": 0,\n \"num_time_units\": 0,\n \"time_unit\": \"day\"\n }\n ]\n },\n \"supported_environments\": [\n \"web\",\n \"app\"\n ]\n },\n \"last_comment\": \"\",\n \"no\": 0,\n \"status\": \"pending\"\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"