Update Campaigns
캠페인 등록
캠페인 정보를 캐시에 저장합니다. 광고 선택 및 중재 로직에서 사용됩니다.
curl --request POST \
--url https://your_a2_service/api/cache/campaigns \
--header 'Content-Type: application/json' \
--data '
[
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "<string>",
"target_cpa": 123,
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"crid": "<string>",
"daily_budget": 123,
"max_bid": 0,
"min_daily_imp": 1000,
"sub_goal": "maximize_volume",
"tagid": "<string>",
"target_cpm": 0,
"target_volume": 0
}
]
'import requests
url = "https://your_a2_service/api/cache/campaigns"
payload = [
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "<string>",
"target_cpa": 123,
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"crid": "<string>",
"daily_budget": 123,
"max_bid": 0,
"min_daily_imp": 1000,
"sub_goal": "maximize_volume",
"tagid": "<string>",
"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: '<string>',
start_date: '2023-11-07T05:31:56Z',
status: '<string>',
target_cpa: 123,
audience_segments: {method: '<string>', segment_list: [{id: '<string>', name: '<string>'}]},
bid_strategy: 'highest_volume',
crid: '<string>',
daily_budget: 123,
max_bid: 0,
min_daily_imp: 1000,
sub_goal: 'maximize_volume',
tagid: '<string>',
target_cpm: 0,
target_volume: 0
}
])
};
fetch('https://your_a2_service/api/cache/campaigns', 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/cache/campaigns",
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' => '<string>',
'start_date' => '2023-11-07T05:31:56Z',
'status' => '<string>',
'target_cpa' => 123,
'audience_segments' => [
'method' => '<string>',
'segment_list' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
],
'bid_strategy' => 'highest_volume',
'crid' => '<string>',
'daily_budget' => 123,
'max_bid' => 0,
'min_daily_imp' => 1000,
'sub_goal' => 'maximize_volume',
'tagid' => '<string>',
'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/api/cache/campaigns"
payload := strings.NewReader("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\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/api/cache/campaigns")
.header("Content-Type", "application/json")
.body("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/campaigns")
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\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]"
response = http.request(request)
puts response.read_body본문
Total budget of the campaign
End date of the campaign (UTC)
Goal of the campaign
ID of the campaign (uuid4)
Start date of the campaign (UTC)
Status of the campaign
Target cost per acquisition (CPA) for the campaign
Optional audience segments associated with the campaign
Show child attributes
Show child attributes
Bid strategy for the campaign (default: "highest_volume")
Optional creative ID associated with the campaign
Optional daily budget of the campaign
Maximum bid amount for the campaign (default: 0.0)
Minimum daily impressions for the campaign (default: 1000.0)
Sub-goal of the campaign (default: "maximize_volume")
Optional tag ID associated with the campaign
Target cost per thousand impressions (CPM) for the campaign (default: 0.0)
Target volume for the campaign (default: 0.0)
응답
성공
이 페이지가 도움이 되었나요?
curl --request POST \
--url https://your_a2_service/api/cache/campaigns \
--header 'Content-Type: application/json' \
--data '
[
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "<string>",
"target_cpa": 123,
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"crid": "<string>",
"daily_budget": 123,
"max_bid": 0,
"min_daily_imp": 1000,
"sub_goal": "maximize_volume",
"tagid": "<string>",
"target_cpm": 0,
"target_volume": 0
}
]
'import requests
url = "https://your_a2_service/api/cache/campaigns"
payload = [
{
"budget": 123,
"end_date": "2023-11-07T05:31:56Z",
"goal": "<string>",
"id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"status": "<string>",
"target_cpa": 123,
"audience_segments": {
"method": "<string>",
"segment_list": [
{
"id": "<string>",
"name": "<string>"
}
]
},
"bid_strategy": "highest_volume",
"crid": "<string>",
"daily_budget": 123,
"max_bid": 0,
"min_daily_imp": 1000,
"sub_goal": "maximize_volume",
"tagid": "<string>",
"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: '<string>',
start_date: '2023-11-07T05:31:56Z',
status: '<string>',
target_cpa: 123,
audience_segments: {method: '<string>', segment_list: [{id: '<string>', name: '<string>'}]},
bid_strategy: 'highest_volume',
crid: '<string>',
daily_budget: 123,
max_bid: 0,
min_daily_imp: 1000,
sub_goal: 'maximize_volume',
tagid: '<string>',
target_cpm: 0,
target_volume: 0
}
])
};
fetch('https://your_a2_service/api/cache/campaigns', 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/cache/campaigns",
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' => '<string>',
'start_date' => '2023-11-07T05:31:56Z',
'status' => '<string>',
'target_cpa' => 123,
'audience_segments' => [
'method' => '<string>',
'segment_list' => [
[
'id' => '<string>',
'name' => '<string>'
]
]
],
'bid_strategy' => 'highest_volume',
'crid' => '<string>',
'daily_budget' => 123,
'max_bid' => 0,
'min_daily_imp' => 1000,
'sub_goal' => 'maximize_volume',
'tagid' => '<string>',
'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/api/cache/campaigns"
payload := strings.NewReader("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\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/api/cache/campaigns")
.header("Content-Type", "application/json")
.body("[\n {\n \"budget\": 123,\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"goal\": \"<string>\",\n \"id\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/cache/campaigns")
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\": \"<string>\",\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"status\": \"<string>\",\n \"target_cpa\": 123,\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 \"crid\": \"<string>\",\n \"daily_budget\": 123,\n \"max_bid\": 0,\n \"min_daily_imp\": 1000,\n \"sub_goal\": \"maximize_volume\",\n \"tagid\": \"<string>\",\n \"target_cpm\": 0,\n \"target_volume\": 0\n }\n]"
response = http.request(request)
puts response.read_body