Cache Management
할당 등록
ad_unit과 line_item 간의 할당 정보를 저장합니다. 중재 중 적격한 line_item을 결정하는 데 사용합니다.
POST
/
app
/
api
/
cache
/
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>"본문
application/json
소유자 ID입니다.
리소스 ID입니다(line_items.id 또는 recommendation_policies.id).
대상에 할당된 리소스 유형입니다(line_item / recommendation_policy).
사용 가능한 옵션:
line_item, recommendation_policy 대상 ID입니다(ad_units.id 또는 placements.id).
대상 유형입니다(ad_unit / placement).
사용 가능한 옵션:
ad_unit, placement 다양한 설정을 위한 확장 정보입니다.
Show child attributes
Show child attributes
마지막 코멘트
할당의 ID입니다.
할당의 현재 상태입니다(예: pending, published, rejected).
사용 가능한 옵션:
pending, requested, published, rejected, canceled, finished 응답
성공
이 페이지가 도움이 되었나요?
⌘I
할당 등록
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>"