라인 아이템 등록
캐시에 라인 아이템 정보를 저장합니다. 광고 선택 및 중재 로직에서 사용합니다.
curl --request POST \
--url https://your_a2_service/app/api/cache/line-items \
--header 'Content-Type: application/json' \
--data '
[
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"target_cpa": 123,
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": {
"conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
]
},
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [
1
],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
'import requests
url = "https://your_a2_service/app/api/cache/line-items"
payload = [
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"target_cpa": 123,
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": { "conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
] },
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [1],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
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([
{
budget: 123,
end_date: '2023-11-07T05:31:56Z',
goal: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
oid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start_date: '2023-11-07T05:31:56Z',
target_cpa: 123,
ad_type: 'standard',
audience_segments: {method: '<string>', segment_list: [{id: '<string>', name: '<string>'}]},
bid_strategy: 'highest_volume',
creative_rotation: {
admission_confidence_penalty: 0,
posterior_temperature: 1,
prior_weight: 100,
temperature: 1,
type: 'optimized',
weights: []
},
custom_targeting: {
conditions: [
{
key: {code: '<string>', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
values: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>',
match_type: 'exact'
}
]
}
]
},
daily_budget: 123,
description: '<string>',
ext: '<unknown>',
max_bid: 0,
min_daily_imp: 1000,
pace_method: 'evenly',
priority: 8,
schedule: {
days_of_week: [1],
time_ranges: [{end: '<string>', start: '<string>'}],
timezone: '<string>'
},
sub_goal: 'maximize_volume',
target_cpm: 0,
target_volume: 0
}
])
};
fetch('https://your_a2_service/app/api/cache/line-items', 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/line-items",
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([
[
'budget' => 123,
'end_date' => '2023-11-07T05:31:56Z',
'goal' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'oid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'start_date' => '2023-11-07T05:31:56Z',
'target_cpa' => 123,
'ad_type' => 'standard',
'audience_segments' => [
'method' => '<string>',
'segment_list' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
],
'bid_strategy' => 'highest_volume',
'creative_rotation' => [
'admission_confidence_penalty' => 0,
'posterior_temperature' => 1,
'prior_weight' => 100,
'temperature' => 1,
'type' => 'optimized',
'weights' => [
]
],
'custom_targeting' => [
'conditions' => [
[
'key' => [
'code' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'values' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>',
'match_type' => 'exact'
]
]
]
]
],
'daily_budget' => 123,
'description' => '<string>',
'ext' => '<unknown>',
'max_bid' => 0,
'min_daily_imp' => 1000,
'pace_method' => 'evenly',
'priority' => 8,
'schedule' => [
'days_of_week' => [
1
],
'time_ranges' => [
[
'end' => '<string>',
'start' => '<string>'
]
],
'timezone' => '<string>'
],
'sub_goal' => 'maximize_volume',
'target_cpm' => 0,
'target_volume' => 0
]
]),
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/line-items"
payload := strings.NewReader("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\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/line-items")
.header("Content-Type", "application/json")
.body("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/api/cache/line-items")
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 \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"본문
총 예산입니다.
라인 아이템의 종료일(UTC)입니다.
목표입니다.
라인 아이템의 ID(uuid7)입니다.
라인 아이템의 이름입니다.
상위 오더 ID입니다.
소유자 ID입니다.
라인 아이템의 시작일(UTC)입니다.
라인 아이템의 상태입니다(draft, ready, preparing, delivering, archived).
draft, ready, preparing, delivering, archived 목표 CPA입니다.
라인 아이템의 광고 유형입니다(예: "standard", "decision").
라인 아이템과 연결된 선택적 오디언스 세그먼트입니다.
Show child attributes
Show child attributes
라인 아이템의 입찰 전략입니다(기본값: "highest_volume").
크리에이티브 순환 전략입니다.
Show child attributes
Show child attributes
라인 아이템의 선택적 사용자 지정 타기팅 조건입니다.
Show child attributes
Show child attributes
라인 아이템의 선택적 일일 예산입니다.
라인 아이템의 선택적 설명입니다.
라인 아이템의 선택적 확장 정보입니다.
라인 아이템의 최대 입찰 금액입니다(기본값: 0.0).
라인 아이템의 최소 일일 노출 수입니다(기본값: 1000.0).
페이싱 방식입니다.
우선순위입니다.
x >= 0라인 아이템의 선택적 일정입니다.
Show child attributes
Show child attributes
라인 아이템의 하위 목표입니다(기본값: "maximize_volume").
라인 아이템의 1,000회 노출당 목표 비용(CPM)입니다(기본값: 0.0).
라인 아이템의 목표 물량입니다(기본값: 0.0).
응답
성공
이 페이지가 도움이 되었나요?
curl --request POST \
--url https://your_a2_service/app/api/cache/line-items \
--header 'Content-Type: application/json' \
--data '
[
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"target_cpa": 123,
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": {
"conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
]
},
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [
1
],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
'import requests
url = "https://your_a2_service/app/api/cache/line-items"
payload = [
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"oid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"target_cpa": 123,
"ad_type": "standard",
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"creative_rotation": {
"admission_confidence_penalty": 0,
"posterior_temperature": 1,
"prior_weight": 100,
"temperature": 1,
"type": "optimized",
"weights": []
},
"custom_targeting": { "conditions": [
{
"key": {
"code": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"match_type": "exact"
}
]
}
] },
"daily_budget": 123,
"description": "<string>",
"ext": "<unknown>",
"max_bid": 0,
"min_daily_imp": 1000,
"pace_method": "evenly",
"priority": 8,
"schedule": {
"days_of_week": [1],
"time_ranges": [
{
"end": "<string>",
"start": "<string>"
}
],
"timezone": "<string>"
},
"sub_goal": "maximize_volume",
"target_cpm": 0,
"target_volume": 0
}
]
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([
{
budget: 123,
end_date: '2023-11-07T05:31:56Z',
goal: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
oid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
start_date: '2023-11-07T05:31:56Z',
target_cpa: 123,
ad_type: 'standard',
audience_segments: {method: '<string>', segment_list: [{id: '<string>', name: '<string>'}]},
bid_strategy: 'highest_volume',
creative_rotation: {
admission_confidence_penalty: 0,
posterior_temperature: 1,
prior_weight: 100,
temperature: 1,
type: 'optimized',
weights: []
},
custom_targeting: {
conditions: [
{
key: {code: '<string>', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
values: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
value: '<string>',
match_type: 'exact'
}
]
}
]
},
daily_budget: 123,
description: '<string>',
ext: '<unknown>',
max_bid: 0,
min_daily_imp: 1000,
pace_method: 'evenly',
priority: 8,
schedule: {
days_of_week: [1],
time_ranges: [{end: '<string>', start: '<string>'}],
timezone: '<string>'
},
sub_goal: 'maximize_volume',
target_cpm: 0,
target_volume: 0
}
])
};
fetch('https://your_a2_service/app/api/cache/line-items', 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/line-items",
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([
[
'budget' => 123,
'end_date' => '2023-11-07T05:31:56Z',
'goal' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'oid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'start_date' => '2023-11-07T05:31:56Z',
'target_cpa' => 123,
'ad_type' => 'standard',
'audience_segments' => [
'method' => '<string>',
'segment_list' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
],
'bid_strategy' => 'highest_volume',
'creative_rotation' => [
'admission_confidence_penalty' => 0,
'posterior_temperature' => 1,
'prior_weight' => 100,
'temperature' => 1,
'type' => 'optimized',
'weights' => [
]
],
'custom_targeting' => [
'conditions' => [
[
'key' => [
'code' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'values' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'value' => '<string>',
'match_type' => 'exact'
]
]
]
]
],
'daily_budget' => 123,
'description' => '<string>',
'ext' => '<unknown>',
'max_bid' => 0,
'min_daily_imp' => 1000,
'pace_method' => 'evenly',
'priority' => 8,
'schedule' => [
'days_of_week' => [
1
],
'time_ranges' => [
[
'end' => '<string>',
'start' => '<string>'
]
],
'timezone' => '<string>'
],
'sub_goal' => 'maximize_volume',
'target_cpm' => 0,
'target_volume' => 0
]
]),
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/line-items"
payload := strings.NewReader("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\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/line-items")
.header("Content-Type", "application/json")
.body("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/app/api/cache/line-items")
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 \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"oid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"target_cpa\": 123,\n \"ad_type\": \"standard\",\n \"audience_segments\": {\n \"method\": \"<string>\",\n \"segment_list\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ]\n },\n \"bid_strategy\": \"highest_volume\",\n \"creative_rotation\": {\n \"admission_confidence_penalty\": 0,\n \"posterior_temperature\": 1,\n \"prior_weight\": 100,\n \"temperature\": 1,\n \"type\": \"optimized\",\n \"weights\": []\n },\n \"custom_targeting\": {\n \"conditions\": [\n {\n \"key\": {\n \"code\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"values\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"value\": \"<string>\",\n \"match_type\": \"exact\"\n }\n ]\n }\n ]\n },\n \"daily_budget\": 123,\n \"description\": \"<string>\",\n \"ext\": \"<unknown>\",\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"pace_method\": \"evenly\",\n \"priority\": 8,\n \"schedule\": {\n \"days_of_week\": [\n 1\n ],\n \"time_ranges\": [\n {\n \"end\": \"<string>\",\n \"start\": \"<string>\"\n }\n ],\n \"timezone\": \"<string>\"\n },\n \"sub_goal\": \"maximize_volume\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]"
response = http.request(request)
puts response.read_body"<string>""<string>""<string>"