Create a DRAFT campaign (confirm currency first)
curl --request POST \
--url https://api.semicola.com/api/v2/buyer/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"advertiserId": 123,
"name": "<string>",
"flightDates": {
"startDate": "<string>",
"endDate": "<string>"
},
"budget": {
"total": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN"
},
"brief": "<string>",
"management": "managed",
"constraints": {
"countries": [
"<string>"
],
"channels": [],
"geoRegions": [
"<string>"
],
"geoMetros": [
"<string>"
],
"language": "<string>",
"audience": "<string>"
},
"storefrontIds": [
123
],
"discoveryId": "<string>"
}
'import requests
url = "https://api.semicola.com/api/v2/buyer/campaigns"
payload = {
"advertiserId": 123,
"name": "<string>",
"flightDates": {
"startDate": "<string>",
"endDate": "<string>"
},
"budget": {
"total": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN"
},
"brief": "<string>",
"management": "managed",
"constraints": {
"countries": ["<string>"],
"channels": [],
"geoRegions": ["<string>"],
"geoMetros": ["<string>"],
"language": "<string>",
"audience": "<string>"
},
"storefrontIds": [123],
"discoveryId": "<string>"
}
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({
advertiserId: 123,
name: '<string>',
flightDates: {startDate: '<string>', endDate: '<string>'},
budget: {total: '<string>', currency: '<string>', dailyCap: '<string>', pacing: 'EVEN'},
brief: '<string>',
management: 'managed',
constraints: {
countries: ['<string>'],
channels: [],
geoRegions: ['<string>'],
geoMetros: ['<string>'],
language: '<string>',
audience: '<string>'
},
storefrontIds: [123],
discoveryId: '<string>'
})
};
fetch('https://api.semicola.com/api/v2/buyer/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://api.semicola.com/api/v2/buyer/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([
'advertiserId' => 123,
'name' => '<string>',
'flightDates' => [
'startDate' => '<string>',
'endDate' => '<string>'
],
'budget' => [
'total' => '<string>',
'currency' => '<string>',
'dailyCap' => '<string>',
'pacing' => 'EVEN'
],
'brief' => '<string>',
'management' => 'managed',
'constraints' => [
'countries' => [
'<string>'
],
'channels' => [
],
'geoRegions' => [
'<string>'
],
'geoMetros' => [
'<string>'
],
'language' => '<string>',
'audience' => '<string>'
],
'storefrontIds' => [
123
],
'discoveryId' => '<string>'
]),
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://api.semicola.com/api/v2/buyer/campaigns"
payload := strings.NewReader("{\n \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\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://api.semicola.com/api/v2/buyer/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.semicola.com/api/v2/buyer/campaigns")
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 \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign": {
"id": "<string>",
"advertiserId": 123,
"customerId": 123,
"name": "<string>",
"brief": "<string>",
"status": "DRAFT",
"management": "managed",
"flightStart": "2023-11-07T05:31:56Z",
"flightEnd": "2023-11-07T05:31:56Z",
"budgetTotal": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN",
"constraints": {
"countries": [
"<string>"
],
"channels": [
"display"
],
"geoRegions": [
"<string>"
],
"geoMetros": [
"<string>"
],
"language": "<string>",
"audience": "<string>",
"ageRange": {
"min": 0,
"max": 0
}
},
"channelGroups": [
{
"channelGroupId": "<string>",
"name": "<string>",
"channels": [
"display"
],
"budgetShare": 0.5
}
],
"performanceConfig": {},
"autonomy": {
"inventorySelection": "manual",
"rebriefing": "manual"
},
"frequencyCaps": [
{
"maxImpressions": 123,
"window": "<string>"
}
],
"labels": {},
"discoveryId": "<string>",
"revision": 4503599627370495,
"launchedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
"<string>"
]
},
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": "<unknown>"
}
}Campaigns
Create a DRAFT campaign (confirm currency first)
POST
/
api
/
v2
/
buyer
/
campaigns
Create a DRAFT campaign (confirm currency first)
curl --request POST \
--url https://api.semicola.com/api/v2/buyer/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"advertiserId": 123,
"name": "<string>",
"flightDates": {
"startDate": "<string>",
"endDate": "<string>"
},
"budget": {
"total": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN"
},
"brief": "<string>",
"management": "managed",
"constraints": {
"countries": [
"<string>"
],
"channels": [],
"geoRegions": [
"<string>"
],
"geoMetros": [
"<string>"
],
"language": "<string>",
"audience": "<string>"
},
"storefrontIds": [
123
],
"discoveryId": "<string>"
}
'import requests
url = "https://api.semicola.com/api/v2/buyer/campaigns"
payload = {
"advertiserId": 123,
"name": "<string>",
"flightDates": {
"startDate": "<string>",
"endDate": "<string>"
},
"budget": {
"total": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN"
},
"brief": "<string>",
"management": "managed",
"constraints": {
"countries": ["<string>"],
"channels": [],
"geoRegions": ["<string>"],
"geoMetros": ["<string>"],
"language": "<string>",
"audience": "<string>"
},
"storefrontIds": [123],
"discoveryId": "<string>"
}
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({
advertiserId: 123,
name: '<string>',
flightDates: {startDate: '<string>', endDate: '<string>'},
budget: {total: '<string>', currency: '<string>', dailyCap: '<string>', pacing: 'EVEN'},
brief: '<string>',
management: 'managed',
constraints: {
countries: ['<string>'],
channels: [],
geoRegions: ['<string>'],
geoMetros: ['<string>'],
language: '<string>',
audience: '<string>'
},
storefrontIds: [123],
discoveryId: '<string>'
})
};
fetch('https://api.semicola.com/api/v2/buyer/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://api.semicola.com/api/v2/buyer/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([
'advertiserId' => 123,
'name' => '<string>',
'flightDates' => [
'startDate' => '<string>',
'endDate' => '<string>'
],
'budget' => [
'total' => '<string>',
'currency' => '<string>',
'dailyCap' => '<string>',
'pacing' => 'EVEN'
],
'brief' => '<string>',
'management' => 'managed',
'constraints' => [
'countries' => [
'<string>'
],
'channels' => [
],
'geoRegions' => [
'<string>'
],
'geoMetros' => [
'<string>'
],
'language' => '<string>',
'audience' => '<string>'
],
'storefrontIds' => [
123
],
'discoveryId' => '<string>'
]),
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://api.semicola.com/api/v2/buyer/campaigns"
payload := strings.NewReader("{\n \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\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://api.semicola.com/api/v2/buyer/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.semicola.com/api/v2/buyer/campaigns")
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 \"advertiserId\": 123,\n \"name\": \"<string>\",\n \"flightDates\": {\n \"startDate\": \"<string>\",\n \"endDate\": \"<string>\"\n },\n \"budget\": {\n \"total\": \"<string>\",\n \"currency\": \"<string>\",\n \"dailyCap\": \"<string>\",\n \"pacing\": \"EVEN\"\n },\n \"brief\": \"<string>\",\n \"management\": \"managed\",\n \"constraints\": {\n \"countries\": [\n \"<string>\"\n ],\n \"channels\": [],\n \"geoRegions\": [\n \"<string>\"\n ],\n \"geoMetros\": [\n \"<string>\"\n ],\n \"language\": \"<string>\",\n \"audience\": \"<string>\"\n },\n \"storefrontIds\": [\n 123\n ],\n \"discoveryId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"campaign": {
"id": "<string>",
"advertiserId": 123,
"customerId": 123,
"name": "<string>",
"brief": "<string>",
"status": "DRAFT",
"management": "managed",
"flightStart": "2023-11-07T05:31:56Z",
"flightEnd": "2023-11-07T05:31:56Z",
"budgetTotal": "<string>",
"currency": "<string>",
"dailyCap": "<string>",
"pacing": "EVEN",
"constraints": {
"countries": [
"<string>"
],
"channels": [
"display"
],
"geoRegions": [
"<string>"
],
"geoMetros": [
"<string>"
],
"language": "<string>",
"audience": "<string>",
"ageRange": {
"min": 0,
"max": 0
}
},
"channelGroups": [
{
"channelGroupId": "<string>",
"name": "<string>",
"channels": [
"display"
],
"budgetShare": 0.5
}
],
"performanceConfig": {},
"autonomy": {
"inventorySelection": "manual",
"rebriefing": "manual"
},
"frequencyCaps": [
{
"maxImpressions": 123,
"window": "<string>"
}
],
"labels": {},
"discoveryId": "<string>",
"revision": 4503599627370495,
"launchedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"warnings": [
"<string>"
]
},
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": "<unknown>"
}
}Authorizations
bearerAuthsessionCookie
API key or OAuth access token.
Headers
Required string length:
16 - 255Pattern:
^[A-Za-z0-9_.:-]+$Body
application/json
Required range:
x <= 9007199254740991Required string length:
1 - 200Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
20000Available options:
managed, tracked Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
x <= 9007199254740991