메인 콘텐츠로 건너뛰기
POST
/
api
/
cache
/
campaigns
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

본문

application/json
budget
number<double>
필수

Total budget of the campaign

end_date
string<date-time>
필수

End date of the campaign (UTC)

goal
string
필수

Goal of the campaign

id
string
필수

ID of the campaign (uuid4)

start_date
string<date-time>
필수

Start date of the campaign (UTC)

status
string
필수

Status of the campaign

target_cpa
number<double>
필수

Target cost per acquisition (CPA) for the campaign

audience_segments
object | null

Optional audience segments associated with the campaign

bid_strategy
string
기본값:highest_volume

Bid strategy for the campaign (default: "highest_volume")

crid
string | null

Optional creative ID associated with the campaign

daily_budget
number<double> | null

Optional daily budget of the campaign

max_bid
number<double>
기본값:0

Maximum bid amount for the campaign (default: 0.0)

min_daily_imp
number<double>
기본값:1000

Minimum daily impressions for the campaign (default: 1000.0)

sub_goal
string
기본값:maximize_volume

Sub-goal of the campaign (default: "maximize_volume")

tagid
string | null

Optional tag ID associated with the campaign

target_cpm
number<double>
기본값:0

Target cost per thousand impressions (CPM) for the campaign (default: 0.0)

target_volume
number<double>
기본값:0

Target volume for the campaign (default: 0.0)

응답

성공