curl --request POST \
--url https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bola-Bola Ad campaign",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"bids": [
{
"target": {
"id": "p_8983",
"type": "product"
},
"triggers": [
{
"type": "categories",
"value": {
"fromProduct": "<string>"
}
}
],
"formatProperties": {
"imageAssets": [
{
"height": 123,
"width": 123,
"contentType": "<string>",
"contentLength": 123,
"url": "<string>"
}
]
},
"amount": "<unknown>",
"location": "Santiago"
}
],
"exclusivityPrice": 123,
"isActive": true,
"status": "approved",
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": true,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": true,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": true,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
}
}
'import requests
url = "https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive"
payload = {
"name": "Bola-Bola Ad campaign",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"bids": [
{
"target": {
"id": "p_8983",
"type": "product"
},
"triggers": [
{
"type": "categories",
"value": { "fromProduct": "<string>" }
}
],
"formatProperties": { "imageAssets": [
{
"height": 123,
"width": 123,
"contentType": "<string>",
"contentLength": 123,
"url": "<string>"
}
] },
"amount": "<unknown>",
"location": "Santiago"
}
],
"exclusivityPrice": 123,
"isActive": True,
"status": "approved",
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": True,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": True,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": True,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<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({
name: 'Bola-Bola Ad campaign',
slotId: '<string>',
schedule: [{startDate: '2023-11-07T05:31:56Z', endDate: '2023-11-07T05:31:56Z'}],
content: {},
bids: [
{
target: {id: 'p_8983', type: 'product'},
triggers: [{type: 'categories', value: {fromProduct: '<string>'}}],
formatProperties: {
imageAssets: [
{
height: 123,
width: 123,
contentType: '<string>',
contentLength: 123,
url: '<string>'
}
]
},
amount: '<unknown>',
location: 'Santiago'
}
],
exclusivityPrice: 123,
isActive: true,
status: 'approved',
externalCampaignId: '<string>',
walletId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
impressionsThreshold: 123,
exclusivityPercentage: 123,
position: 1,
multiplierConfig: {
isActive: true,
multipliers: [{type: 'user_segment', segmentId: '<string>', multiplier: 0.5}]
},
targetingFilters: {
isActive: true,
targetingFilters: [{type: 'user_segment', segmentId: '<string>'}]
},
exclusionFilters: {
isActive: true,
exclusionFilters: [{type: 'user_segment', segmentId: '<string>'}]
}
})
};
fetch('https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive', 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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive",
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([
'name' => 'Bola-Bola Ad campaign',
'slotId' => '<string>',
'schedule' => [
[
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
]
],
'content' => [
],
'bids' => [
[
'target' => [
'id' => 'p_8983',
'type' => 'product'
],
'triggers' => [
[
'type' => 'categories',
'value' => [
'fromProduct' => '<string>'
]
]
],
'formatProperties' => [
'imageAssets' => [
[
'height' => 123,
'width' => 123,
'contentType' => '<string>',
'contentLength' => 123,
'url' => '<string>'
]
]
],
'amount' => '<unknown>',
'location' => 'Santiago'
]
],
'exclusivityPrice' => 123,
'isActive' => true,
'status' => 'approved',
'externalCampaignId' => '<string>',
'walletId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'impressionsThreshold' => 123,
'exclusivityPercentage' => 123,
'position' => 1,
'multiplierConfig' => [
'isActive' => true,
'multipliers' => [
[
'type' => 'user_segment',
'segmentId' => '<string>',
'multiplier' => 0.5
]
]
],
'targetingFilters' => [
'isActive' => true,
'targetingFilters' => [
[
'type' => 'user_segment',
'segmentId' => '<string>'
]
]
],
'exclusionFilters' => [
'isActive' => true,
'exclusionFilters' => [
[
'type' => 'user_segment',
'segmentId' => '<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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive"
payload := strings.NewReader("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive")
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 \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"marketplaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorId": "<string>",
"name": "Bola-Bola Ad campaign",
"isActive": true,
"status": "approved",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"exclusivityPrice": 123,
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bidType": "exclusive",
"chargeType": "DAILY",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": true,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": true,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": true,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create an exclusive sponsored brand campaign.
Create an exclusive sponsored brand campaign using external vendor and slot identifiers. Exclusive campaigns override auctions and are charged a fixed daily price.
curl --request POST \
--url https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bola-Bola Ad campaign",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"bids": [
{
"target": {
"id": "p_8983",
"type": "product"
},
"triggers": [
{
"type": "categories",
"value": {
"fromProduct": "<string>"
}
}
],
"formatProperties": {
"imageAssets": [
{
"height": 123,
"width": 123,
"contentType": "<string>",
"contentLength": 123,
"url": "<string>"
}
]
},
"amount": "<unknown>",
"location": "Santiago"
}
],
"exclusivityPrice": 123,
"isActive": true,
"status": "approved",
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": true,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": true,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": true,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
}
}
'import requests
url = "https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive"
payload = {
"name": "Bola-Bola Ad campaign",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"bids": [
{
"target": {
"id": "p_8983",
"type": "product"
},
"triggers": [
{
"type": "categories",
"value": { "fromProduct": "<string>" }
}
],
"formatProperties": { "imageAssets": [
{
"height": 123,
"width": 123,
"contentType": "<string>",
"contentLength": 123,
"url": "<string>"
}
] },
"amount": "<unknown>",
"location": "Santiago"
}
],
"exclusivityPrice": 123,
"isActive": True,
"status": "approved",
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": True,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": True,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": True,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<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({
name: 'Bola-Bola Ad campaign',
slotId: '<string>',
schedule: [{startDate: '2023-11-07T05:31:56Z', endDate: '2023-11-07T05:31:56Z'}],
content: {},
bids: [
{
target: {id: 'p_8983', type: 'product'},
triggers: [{type: 'categories', value: {fromProduct: '<string>'}}],
formatProperties: {
imageAssets: [
{
height: 123,
width: 123,
contentType: '<string>',
contentLength: 123,
url: '<string>'
}
]
},
amount: '<unknown>',
location: 'Santiago'
}
],
exclusivityPrice: 123,
isActive: true,
status: 'approved',
externalCampaignId: '<string>',
walletId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
impressionsThreshold: 123,
exclusivityPercentage: 123,
position: 1,
multiplierConfig: {
isActive: true,
multipliers: [{type: 'user_segment', segmentId: '<string>', multiplier: 0.5}]
},
targetingFilters: {
isActive: true,
targetingFilters: [{type: 'user_segment', segmentId: '<string>'}]
},
exclusionFilters: {
isActive: true,
exclusionFilters: [{type: 'user_segment', segmentId: '<string>'}]
}
})
};
fetch('https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive', 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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive",
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([
'name' => 'Bola-Bola Ad campaign',
'slotId' => '<string>',
'schedule' => [
[
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
]
],
'content' => [
],
'bids' => [
[
'target' => [
'id' => 'p_8983',
'type' => 'product'
],
'triggers' => [
[
'type' => 'categories',
'value' => [
'fromProduct' => '<string>'
]
]
],
'formatProperties' => [
'imageAssets' => [
[
'height' => 123,
'width' => 123,
'contentType' => '<string>',
'contentLength' => 123,
'url' => '<string>'
]
]
],
'amount' => '<unknown>',
'location' => 'Santiago'
]
],
'exclusivityPrice' => 123,
'isActive' => true,
'status' => 'approved',
'externalCampaignId' => '<string>',
'walletId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'impressionsThreshold' => 123,
'exclusivityPercentage' => 123,
'position' => 1,
'multiplierConfig' => [
'isActive' => true,
'multipliers' => [
[
'type' => 'user_segment',
'segmentId' => '<string>',
'multiplier' => 0.5
]
]
],
'targetingFilters' => [
'isActive' => true,
'targetingFilters' => [
[
'type' => 'user_segment',
'segmentId' => '<string>'
]
]
],
'exclusionFilters' => [
'isActive' => true,
'exclusionFilters' => [
[
'type' => 'user_segment',
'segmentId' => '<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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive"
payload := strings.NewReader("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\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.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive")
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 \"name\": \"Bola-Bola Ad campaign\",\n \"slotId\": \"<string>\",\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"content\": {},\n \"bids\": [\n {\n \"target\": {\n \"id\": \"p_8983\",\n \"type\": \"product\"\n },\n \"triggers\": [\n {\n \"type\": \"categories\",\n \"value\": {\n \"fromProduct\": \"<string>\"\n }\n }\n ],\n \"formatProperties\": {\n \"imageAssets\": [\n {\n \"height\": 123,\n \"width\": 123,\n \"contentType\": \"<string>\",\n \"contentLength\": 123,\n \"url\": \"<string>\"\n }\n ]\n },\n \"amount\": \"<unknown>\",\n \"location\": \"Santiago\"\n }\n ],\n \"exclusivityPrice\": 123,\n \"isActive\": true,\n \"status\": \"approved\",\n \"externalCampaignId\": \"<string>\",\n \"walletId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\n \"position\": 1,\n \"multiplierConfig\": {\n \"isActive\": true,\n \"multipliers\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\",\n \"multiplier\": 0.5\n }\n ]\n },\n \"targetingFilters\": {\n \"isActive\": true,\n \"targetingFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n },\n \"exclusionFilters\": {\n \"isActive\": true,\n \"exclusionFilters\": [\n {\n \"type\": \"user_segment\",\n \"segmentId\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"campaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"marketplaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorId": "<string>",
"name": "Bola-Bola Ad campaign",
"isActive": true,
"status": "approved",
"slotId": "<string>",
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"content": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"exclusivityPrice": 123,
"externalCampaignId": "<string>",
"walletId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bidType": "exclusive",
"chargeType": "DAILY",
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"position": 1,
"multiplierConfig": {
"isActive": true,
"multipliers": [
{
"type": "user_segment",
"segmentId": "<string>",
"multiplier": 0.5
}
]
},
"targetingFilters": {
"isActive": true,
"targetingFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
},
"exclusionFilters": {
"isActive": true,
"exclusionFilters": [
{
"type": "user_segment",
"segmentId": "<string>"
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Autorizaciones
A valid API key generated in Topsort's UI. Use the TSE API key if calling auctions or events API, otherwise use the TSC API key.
Parámetros de consulta
The ID of the vendor.
1Cuerpo
Request body for creating a public exclusive sponsored brand campaign.
The name of the campaign.
1"Bola-Bola Ad campaign"
The external slot ID where the exclusive sponsored brand campaign will be shown.
1The schedule for the campaign.
1 elementShow child attributes
Show child attributes
Dynamic content validated against the slot's JSON template.
An array of bids for this campaign.
1 - 500 elementsShow child attributes
Show child attributes
The price to pay daily for the campaign to run, in minor units of currency.
Whether the campaign should be activated upon creation.
The initial review status of the sponsored brand campaign.
approved, pending, rejected The external ID of the campaign in the marketplace.
The uuid of the wallet used with this campaign.
Impressions allowed for the campaign before it is stopped.
Percentage of auctions the campaign will be exclusive in.
The rank the ad will have in the auction.
1 <= x <= 20The multipliers of the campaign.
Show child attributes
Show child attributes
The segments that the campaign will participate for.
Show child attributes
Show child attributes
The segments that the campaign will not target.
Show child attributes
Show child attributes
Respuesta
Successful Response
An exclusive sponsored brand campaign returned by the public API.
The ID of the campaign.
The ID of the marketplace.
The external vendor ID.
The name of the campaign.
1"Bola-Bola Ad campaign"
Whether the campaign is active.
The approval status of the sponsored brand campaign.
approved, pending, rejected The external slot ID where the exclusive sponsored brand campaign is shown.
The schedule for the campaign.
1 elementShow child attributes
Show child attributes
Dynamic content validated against the slot's JSON template.
When this campaign was created.
When this campaign was last updated.
The price to pay daily for the campaign to run, in minor units of currency.
The external ID of the campaign in the marketplace.
The uuid of the wallet used with this campaign.
The bidding type of the campaign.
"exclusive"How exclusive campaigns are charged. Only daily is allowed.
DAILY Impressions allowed for the campaign before it is stopped.
Percentage of auctions the campaign will be exclusive in.
The rank the ad will have in the auction.
1 <= x <= 20The multipliers of the campaign.
Show child attributes
Show child attributes
The segments that the campaign will participate for.
Show child attributes
Show child attributes
The segments that the campaign will not target.
Show child attributes
Show child attributes
¿Esta página le ayudó?