광고 단위 생성
새 광고 단위를 생성합니다. code는 저장 시 소문자로 정규화되며 a-z, 0-9, _.*!:()-만 사용할 수 있습니다. 최대 경로 깊이는 6입니다.
접근 제어:
Admin과 Operator 계정은 광고 단위 리소스에 전체 접근 권한(생성/조회/수정/삭제)을 가집니다.
Advertiser 계정은 이 엔드포인트에 접근할 수 없습니다 — 배정 대상 선택용 경량 조회 뷰는 GET /ad-units/targets를 참고하세요.
curl --request POST \
--url https://your_a2_service/api/manager/ad-units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "main-banner",
"description": "홈 화면 상단 배너",
"name": "메인 배너 광고"
}
'import requests
url = "https://your_a2_service/api/manager/ad-units"
payload = {
"code": "main-banner",
"description": "홈 화면 상단 배너",
"name": "메인 배너 광고"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'main-banner', description: '홈 화면 상단 배너', name: '메인 배너 광고'})
};
fetch('https://your_a2_service/api/manager/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/api/manager/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' => 'main-banner',
'description' => '홈 화면 상단 배너',
'name' => '메인 배너 광고'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/manager/ad-units"
payload := strings.NewReader("{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/manager/ad-units")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-units")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"display": {
"ampren": 127,
"api": [
32767
],
"clktype": 1,
"context": "ContentCentric",
"ctype": [
127
],
"displayfmt": {
"expdir": "Left",
"ext": null,
"h": 1,
"hratio": 1,
"w": 1,
"wratio": 1
},
"event": [
{
"type": 1,
"api": [
32767
],
"ext": null,
"jstrk": [
"<string>"
],
"method": [
1
],
"pxtrk": [
"<string>"
],
"wjs": 1,
"wpx": 1
}
],
"ext": null,
"h": 250,
"ifrbust": [
"<string>"
],
"mime": [
"<string>"
],
"pos": "Unknown",
"priv": 0,
"ptype": "Feed",
"topframe": 127,
"unit": 2,
"w": 300
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": {
"enabled": 0
},
"external_raw_data": "<unknown>",
"implicit_app_inference": {
"android_bundle": "<string>",
"app_name": "<string>",
"cat": [
"<string>"
],
"ios_bundle": "<string>",
"ua_keywords": []
},
"metric_mode": "all",
"native": {
"enabled": 0,
"render_mode": "html"
},
"passback": "<unknown>",
"payout": "rates",
"public_url": "<string>",
"publisher": "<unknown>",
"recommendation": {
"enabled": 0
},
"responsive": "fixed",
"target_ecpm": 0,
"target_service": "<string>",
"video": {
"enabled": 0
}
},
"gpid": "<string>",
"instl": 0,
"is_active": true,
"native": {
"assets": []
},
"no": 123,
"recommendation": {
"ext": {},
"topn": 10
},
"updated_at": "2023-11-07T05:31:56Z",
"video": {
"api": [
32767
],
"boxing": 1,
"clktype": 1,
"comp": [
{
"display": {
"ampren": 127,
"api": [
32767
],
"clktype": 1,
"context": "ContentCentric",
"ctype": [
127
],
"displayfmt": {
"expdir": "Left",
"ext": null,
"h": 1,
"hratio": 1,
"w": 1,
"wratio": 1
},
"event": [
{
"type": 1,
"api": [
32767
],
"ext": null,
"jstrk": [
"<string>"
],
"method": [
1
],
"pxtrk": [
"<string>"
],
"wjs": 1,
"wpx": 1
}
],
"ext": null,
"h": 123,
"ifrbust": [
"<string>"
],
"mime": [
"<string>"
],
"pos": "Unknown",
"priv": 0,
"ptype": "Feed",
"topframe": 127,
"unit": 2,
"w": 123
},
"ext": null,
"id": "<string>",
"vcm": 123
}
],
"comptype": [
"Static"
],
"ctype": [
123
],
"delay": 0,
"delivery": [
"Streaming"
],
"expdir": [
"Left"
],
"ext": null,
"h": 300,
"linear": 0,
"maxbitr": 1,
"maxdur": 0,
"maxext": 0,
"maxseq": 1,
"mime": [
"<string>"
],
"minbitr": 1,
"mincpmpersec": 123,
"mindur": 0,
"overlayexpdir": [
"Left"
],
"playend": "OnVideoCompletion",
"playmethod": [
1
],
"poddur": 1,
"podid": 1,
"podseq": 0,
"pos": "Unknown",
"ptype": 1,
"rqddurs": [
1
],
"skip": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2,
"w": 480
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": {
"code": "LICENSE.FILE_NOT_FOUND",
"message": "License file not found. Contact your system administrator."
}
}인증
Bearer 인증. 액세스 토큰을 Authorization: Bearer <token> 헤더로 전달합니다.
본문
POST /ad-units 요청 본문.
경로 해석 규칙:
parent_id없음:path = codeparent_id있음:path = {parent.path}/{code}
광고 단위 코드 식별자. 광고 태그에 사용됩니다. 생성 후 변경 불가. (1-100자)
1 - 100광고 단위 표시 이름 (1-255자).
1 - 255타게팅 메타데이터 크기. 서빙·렌더링을 좌우하는 display/video.w/h와는 별개입니다.
Show child attributes
Show child attributes
광고 단위 설명.
디스플레이 게재 위치 설정.
Show child attributes
Show child attributes
광고 단위 확장 필드.
Show child attributes
Show child attributes
OpenRTB imp.ext.gpid에 사용되는 표준 지면 ID.
인터스티셜 지면 여부. 0 = 아니오, 1 = 예. 디스플레이·동영상·네이티브 전체에 적용됩니다.
0, 1 광고 단위 활성 여부.
네이티브 지면임을 나타내는 지면 서브타입 객체입니다. (AdCOM 표준이 아닌 OpenRTB Native Ads 1.2 Native Markup Request Object 기반)
Show child attributes
Show child attributes
상위 광고 단위 ID. 계층을 결정합니다. 생성 후 변경 불가.
Show child attributes
Show child attributes
비디오 게재 위치 설정.
Show child attributes
Show child attributes
응답
성공 응답
광고 단위 변경(생성/수정) 응답 스키마.
광고 단위 코드 식별자.
광고 단위를 생성한 사용자 ID.
광고 단위 ID (uuid7)
광고 단위 이름.
광고 단위의 계층 경로 (예: "parent_id/child_id").
타게팅 메타데이터 크기. 서빙·렌더링을 좌우하는 display/video.w/h와는 별개입니다.
Show child attributes
Show child attributes
광고 단위 설명.
디스플레이 게재 위치 설정.
Show child attributes
Show child attributes
광고 단위 확장 필드.
Show child attributes
Show child attributes
OpenRTB imp.ext.gpid에 사용되는 표준 지면 ID.
인터스티셜 지면 여부. 0 = 아니오, 1 = 예. 디스플레이·동영상·네이티브 전체에 적용됩니다.
0, 1 광고 단위 활성 여부.
네이티브 지면임을 나타내는 지면 서브타입 객체입니다. (AdCOM 표준이 아닌 OpenRTB Native Ads 1.2 Native Markup Request Object 기반)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
비디오 게재 위치 설정.
Show child attributes
Show child attributes
이 페이지가 도움이 되었나요?
curl --request POST \
--url https://your_a2_service/api/manager/ad-units \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "main-banner",
"description": "홈 화면 상단 배너",
"name": "메인 배너 광고"
}
'import requests
url = "https://your_a2_service/api/manager/ad-units"
payload = {
"code": "main-banner",
"description": "홈 화면 상단 배너",
"name": "메인 배너 광고"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'main-banner', description: '홈 화면 상단 배너', name: '메인 배너 광고'})
};
fetch('https://your_a2_service/api/manager/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/api/manager/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' => 'main-banner',
'description' => '홈 화면 상단 배너',
'name' => '메인 배너 광고'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/manager/ad-units"
payload := strings.NewReader("{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/manager/ad-units")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-units")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"main-banner\",\n \"description\": \"홈 화면 상단 배너\",\n \"name\": \"메인 배너 광고\"\n}"
response = http.request(request)
puts response.read_body{
"code": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"path": "<string>",
"ad_unit_sizes": [
{
"h": 1,
"w": 1
}
],
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"display": {
"ampren": 127,
"api": [
32767
],
"clktype": 1,
"context": "ContentCentric",
"ctype": [
127
],
"displayfmt": {
"expdir": "Left",
"ext": null,
"h": 1,
"hratio": 1,
"w": 1,
"wratio": 1
},
"event": [
{
"type": 1,
"api": [
32767
],
"ext": null,
"jstrk": [
"<string>"
],
"method": [
1
],
"pxtrk": [
"<string>"
],
"wjs": 1,
"wpx": 1
}
],
"ext": null,
"h": 250,
"ifrbust": [
"<string>"
],
"mime": [
"<string>"
],
"pos": "Unknown",
"priv": 0,
"ptype": "Feed",
"topframe": 127,
"unit": 2,
"w": 300
},
"ext": {
"algorithm": "axa0",
"approval_method": "admin",
"bcat": [],
"default_cpa": 0,
"default_cpc": 0,
"display": {
"enabled": 0
},
"external_raw_data": "<unknown>",
"implicit_app_inference": {
"android_bundle": "<string>",
"app_name": "<string>",
"cat": [
"<string>"
],
"ios_bundle": "<string>",
"ua_keywords": []
},
"metric_mode": "all",
"native": {
"enabled": 0,
"render_mode": "html"
},
"passback": "<unknown>",
"payout": "rates",
"public_url": "<string>",
"publisher": "<unknown>",
"recommendation": {
"enabled": 0
},
"responsive": "fixed",
"target_ecpm": 0,
"target_service": "<string>",
"video": {
"enabled": 0
}
},
"gpid": "<string>",
"instl": 0,
"is_active": true,
"native": {
"assets": []
},
"no": 123,
"recommendation": {
"ext": {},
"topn": 10
},
"updated_at": "2023-11-07T05:31:56Z",
"video": {
"api": [
32767
],
"boxing": 1,
"clktype": 1,
"comp": [
{
"display": {
"ampren": 127,
"api": [
32767
],
"clktype": 1,
"context": "ContentCentric",
"ctype": [
127
],
"displayfmt": {
"expdir": "Left",
"ext": null,
"h": 1,
"hratio": 1,
"w": 1,
"wratio": 1
},
"event": [
{
"type": 1,
"api": [
32767
],
"ext": null,
"jstrk": [
"<string>"
],
"method": [
1
],
"pxtrk": [
"<string>"
],
"wjs": 1,
"wpx": 1
}
],
"ext": null,
"h": 123,
"ifrbust": [
"<string>"
],
"mime": [
"<string>"
],
"pos": "Unknown",
"priv": 0,
"ptype": "Feed",
"topframe": 127,
"unit": 2,
"w": 123
},
"ext": null,
"id": "<string>",
"vcm": 123
}
],
"comptype": [
"Static"
],
"ctype": [
123
],
"delay": 0,
"delivery": [
"Streaming"
],
"expdir": [
"Left"
],
"ext": null,
"h": 300,
"linear": 0,
"maxbitr": 1,
"maxdur": 0,
"maxext": 0,
"maxseq": 1,
"mime": [
"<string>"
],
"minbitr": 1,
"mincpmpersec": 123,
"mindur": 0,
"overlayexpdir": [
"Left"
],
"playend": "OnVideoCompletion",
"playmethod": [
1
],
"poddur": 1,
"podid": 1,
"podseq": 0,
"pos": "Unknown",
"ptype": 1,
"rqddurs": [
1
],
"skip": 0,
"skipafter": 0,
"skipmin": 0,
"slotinpod": 0,
"unit": 2,
"w": 480
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": {
"code": "LICENSE.FILE_NOT_FOUND",
"message": "License file not found. Contact your system administrator."
}
}