Cache Management
광고 유닛 등록
캐시에 ad_unit 정보를 저장합니다. 광고 유닛 메타데이터를 기반으로 제공 로직을 갱신하는 데 사용합니다.
POST
/
app
/
api
/
cache
/
ad-units
광고 유닛 등록
curl --request POST \
--url https://your_a2_service/app/api/cache/ad-units \
--header 'Content-Type: application/json' \
--data '
[
{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"description": "<string>",
"display": {
"clktype": 1,
"priv": 0,
"unit": 2
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": {
"enabled": 1
},
"native": {
"enabled": 0,
"render_mode": "html"
},
"payout": "rates",
"recommendation": {
"enabled": 0
},
"responsive": "fixed",
"target_ecpm": 0,
"video": {
"enabled": 0
}
},
"gpid": "<string>",
"instl": 0,
"is_active": true,
"native": {
"assets": []
},
"recommendation": {
"associated_item": {},
"ext": {},
"personalization": {},
"ptype": "associated_item",
"topn": 10
},
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
'import requests
url = "https://your_a2_service/app/api/cache/ad-units"
payload = [
{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"description": "<string>",
"display": {
"clktype": 1,
"priv": 0,
"unit": 2
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": { "enabled": 1 },
"native": {
"enabled": 0,
"render_mode": "html"
},
"payout": "rates",
"recommendation": { "enabled": 0 },
"responsive": "fixed",
"target_ecpm": 0,
"video": { "enabled": 0 }
},
"gpid": "<string>",
"instl": 0,
"is_active": True,
"native": { "assets": [] },
"recommendation": {
"associated_item": {},
"ext": {},
"personalization": {},
"ptype": "associated_item",
"topn": 10
},
"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([
{
code: '<string>',
created_at: '2023-11-07T05:31:56Z',
created_by: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
path: '<string>',
ad_unit_sizes: [{h: 1, w: 1}],
description: '<string>',
display: {clktype: 1, priv: 0, unit: 2},
ext: {
algorithm: 'axa0',
approval_method: 'admin',
bcat: [],
default_cpa: 0,
default_cpc: 0,
display: {enabled: 1},
native: {enabled: 0, render_mode: 'html'},
payout: 'rates',
recommendation: {enabled: 0},
responsive: 'fixed',
target_ecpm: 0,
video: {enabled: 0}
},
gpid: '<string>',
instl: 0,
is_active: true,
native: {assets: []},
recommendation: {
associated_item: {},
ext: {},
personalization: {},
ptype: 'associated_item',
topn: 10
},
video: {
boxing: 1,
maxext: 0,
podseq: 0,
skipafter: 0,
skipmin: 0,
slotinpod: 0,
unit: 2
}
}
])
};
fetch('https://your_a2_service/app/api/cache/ad-units', 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/ad-units",
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([
[
'code' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'created_by' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'path' => '<string>',
'ad_unit_sizes' => [
[
'h' => 1,
'w' => 1
]
],
'description' => '<string>',
'display' => [
'clktype' => 1,
'priv' => 0,
'unit' => 2
],
'ext' => [
'algorithm' => 'axa0',
'approval_method' => 'admin',
'bcat' => [
],
'default_cpa' => 0,
'default_cpc' => 0,
'display' => [
'enabled' => 1
],
'native' => [
'enabled' => 0,
'render_mode' => 'html'
],
'payout' => 'rates',
'recommendation' => [
'enabled' => 0
],
'responsive' => 'fixed',
'target_ecpm' => 0,
'video' => [
'enabled' => 0
]
],
'gpid' => '<string>',
'instl' => 0,
'is_active' => true,
'native' => [
'assets' => [
]
],
'recommendation' => [
'associated_item' => [
],
'ext' => [
],
'personalization' => [
],
'ptype' => 'associated_item',
'topn' => 10
],
'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/app/api/cache/ad-units"
payload := strings.NewReader("[\n {\n \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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/app/api/cache/ad-units")
.header("Content-Type", "application/json")
.body("[\n {\n \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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/app/api/cache/ad-units")
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 \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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"<string>""<string>""<string>"본문
application/json
광고 유닛 코드 식별자입니다.
광고 유닛이 생성된 날짜와 시간입니다.
광고 유닛을 생성한 사용자의 ID입니다.
광고 유닛의 ID(uuid7)입니다.
광고 유닛의 이름입니다.
광고 유닛의 계층형 경로입니다(예: "parent_id/child_id").
타기팅 메타데이터 크기입니다. display/video.w/h의 제공 및 렌더링 크기와는 다릅니다.
Show child attributes
Show child attributes
광고 유닛의 설명입니다.
디스플레이 지면일 수 있음을 나타내는 지면 하위 유형 객체이며 관련 세부 정보를 제공합니다.
Show child attributes
Show child attributes
광고 유닛별 추가 확장 정보이며 기본값은 AdUnitExt 객체입니다.
Show child attributes
Show child attributes
OpenRTB imp.ext.gpid에 대한 표준 지면 ID입니다.
전면 지면인지 나타냅니다. 0은 아니요, 1은 예입니다. 디스플레이, 비디오, 네이티브에 적용됩니다.
사용 가능한 옵션:
0, 1 광고 유닛이 활성 상태인지 나타냅니다.
OpenRTB Native Ads 1.2 Native Markup Request Object를 기반으로 하며 AdCOM 표준 네이티브 형식은 아닙니다.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
비디오 지면일 수 있음을 나타내는 지면 하위 유형 객체이며 관련 세부 정보를 제공합니다.
Show child attributes
Show child attributes
응답
성공
이 페이지가 도움이 되었나요?
⌘I
광고 유닛 등록
curl --request POST \
--url https://your_a2_service/app/api/cache/ad-units \
--header 'Content-Type: application/json' \
--data '
[
{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"description": "<string>",
"display": {
"clktype": 1,
"priv": 0,
"unit": 2
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": {
"enabled": 1
},
"native": {
"enabled": 0,
"render_mode": "html"
},
"payout": "rates",
"recommendation": {
"enabled": 0
},
"responsive": "fixed",
"target_ecpm": 0,
"video": {
"enabled": 0
}
},
"gpid": "<string>",
"instl": 0,
"is_active": true,
"native": {
"assets": []
},
"recommendation": {
"associated_item": {},
"ext": {},
"personalization": {},
"ptype": "associated_item",
"topn": 10
},
"video": {
"boxing": 1,
"maxext": 0,
"podseq": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2
}
}
]
'import requests
url = "https://your_a2_service/app/api/cache/ad-units"
payload = [
{
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"description": "<string>",
"display": {
"clktype": 1,
"priv": 0,
"unit": 2
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": { "enabled": 1 },
"native": {
"enabled": 0,
"render_mode": "html"
},
"payout": "rates",
"recommendation": { "enabled": 0 },
"responsive": "fixed",
"target_ecpm": 0,
"video": { "enabled": 0 }
},
"gpid": "<string>",
"instl": 0,
"is_active": True,
"native": { "assets": [] },
"recommendation": {
"associated_item": {},
"ext": {},
"personalization": {},
"ptype": "associated_item",
"topn": 10
},
"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([
{
code: '<string>',
created_at: '2023-11-07T05:31:56Z',
created_by: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
path: '<string>',
ad_unit_sizes: [{h: 1, w: 1}],
description: '<string>',
display: {clktype: 1, priv: 0, unit: 2},
ext: {
algorithm: 'axa0',
approval_method: 'admin',
bcat: [],
default_cpa: 0,
default_cpc: 0,
display: {enabled: 1},
native: {enabled: 0, render_mode: 'html'},
payout: 'rates',
recommendation: {enabled: 0},
responsive: 'fixed',
target_ecpm: 0,
video: {enabled: 0}
},
gpid: '<string>',
instl: 0,
is_active: true,
native: {assets: []},
recommendation: {
associated_item: {},
ext: {},
personalization: {},
ptype: 'associated_item',
topn: 10
},
video: {
boxing: 1,
maxext: 0,
podseq: 0,
skipafter: 0,
skipmin: 0,
slotinpod: 0,
unit: 2
}
}
])
};
fetch('https://your_a2_service/app/api/cache/ad-units', 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/ad-units",
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([
[
'code' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'created_by' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'path' => '<string>',
'ad_unit_sizes' => [
[
'h' => 1,
'w' => 1
]
],
'description' => '<string>',
'display' => [
'clktype' => 1,
'priv' => 0,
'unit' => 2
],
'ext' => [
'algorithm' => 'axa0',
'approval_method' => 'admin',
'bcat' => [
],
'default_cpa' => 0,
'default_cpc' => 0,
'display' => [
'enabled' => 1
],
'native' => [
'enabled' => 0,
'render_mode' => 'html'
],
'payout' => 'rates',
'recommendation' => [
'enabled' => 0
],
'responsive' => 'fixed',
'target_ecpm' => 0,
'video' => [
'enabled' => 0
]
],
'gpid' => '<string>',
'instl' => 0,
'is_active' => true,
'native' => [
'assets' => [
]
],
'recommendation' => [
'associated_item' => [
],
'ext' => [
],
'personalization' => [
],
'ptype' => 'associated_item',
'topn' => 10
],
'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/app/api/cache/ad-units"
payload := strings.NewReader("[\n {\n \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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/app/api/cache/ad-units")
.header("Content-Type", "application/json")
.body("[\n {\n \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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/app/api/cache/ad-units")
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 \"code\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"created_by\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"path\": \"<string>\",\n \"ad_unit_sizes\": [\n {\n \"h\": 1,\n \"w\": 1\n }\n ],\n \"description\": \"<string>\",\n \"display\": {\n \"clktype\": 1,\n \"priv\": 0,\n \"unit\": 2\n },\n \"ext\": {\n \"algorithm\": \"axa0\",\n \"approval_method\": \"admin\",\n \"bcat\": [],\n \"default_cpa\": 0,\n \"default_cpc\": 0,\n \"display\": {\n \"enabled\": 1\n },\n \"native\": {\n \"enabled\": 0,\n \"render_mode\": \"html\"\n },\n \"payout\": \"rates\",\n \"recommendation\": {\n \"enabled\": 0\n },\n \"responsive\": \"fixed\",\n \"target_ecpm\": 0,\n \"video\": {\n \"enabled\": 0\n }\n },\n \"gpid\": \"<string>\",\n \"instl\": 0,\n \"is_active\": true,\n \"native\": {\n \"assets\": []\n },\n \"recommendation\": {\n \"associated_item\": {},\n \"ext\": {},\n \"personalization\": {},\n \"ptype\": \"associated_item\",\n \"topn\": 10\n },\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"<string>""<string>""<string>"