Update an exclusive sponsored brand campaign.
curl --request PATCH \
--url https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bola-Bola Ad campaign",
"isActive": true,
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"sponsoredBrandRejectionReason": {
"declineReason": "<string>",
"reasonDetails": "<string>"
},
"exclusivityPrice": 1,
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"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>"
}
]
},
"content": {}
}
'import requests
url = "https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}"
payload = {
"name": "Bola-Bola Ad campaign",
"isActive": True,
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"sponsoredBrandRejectionReason": {
"declineReason": "<string>",
"reasonDetails": "<string>"
},
"exclusivityPrice": 1,
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"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>"
}
]
},
"content": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Bola-Bola Ad campaign',
isActive: true,
schedule: [{startDate: '2023-11-07T05:31:56Z', endDate: '2023-11-07T05:31:56Z'}],
sponsoredBrandRejectionReason: {declineReason: '<string>', reasonDetails: '<string>'},
exclusivityPrice: 1,
impressionsThreshold: 123,
exclusivityPercentage: 123,
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>'}]
},
content: {}
})
};
fetch('https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}', 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/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Bola-Bola Ad campaign',
'isActive' => true,
'schedule' => [
[
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
]
],
'sponsoredBrandRejectionReason' => [
'declineReason' => '<string>',
'reasonDetails' => '<string>'
],
'exclusivityPrice' => 1,
'impressionsThreshold' => 123,
'exclusivityPercentage' => 123,
'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>'
]
]
],
'content' => [
]
]),
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/{campaign_id}"
payload := strings.NewReader("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\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>"
}
]
}Campaign API
Update an exclusive sponsored brand campaign.
Partially update an exclusive sponsored brand campaign. Only V2 campaigns are publicly addressable.
PATCH
/
public
/
v1
/
campaign-service
/
campaigns
/
sponsored-brand
/
exclusive
/
{campaign_id}
Update an exclusive sponsored brand campaign.
curl --request PATCH \
--url https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Bola-Bola Ad campaign",
"isActive": true,
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"sponsoredBrandRejectionReason": {
"declineReason": "<string>",
"reasonDetails": "<string>"
},
"exclusivityPrice": 1,
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"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>"
}
]
},
"content": {}
}
'import requests
url = "https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}"
payload = {
"name": "Bola-Bola Ad campaign",
"isActive": True,
"schedule": [
{
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
}
],
"sponsoredBrandRejectionReason": {
"declineReason": "<string>",
"reasonDetails": "<string>"
},
"exclusivityPrice": 1,
"impressionsThreshold": 123,
"exclusivityPercentage": 123,
"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>"
}
]
},
"content": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Bola-Bola Ad campaign',
isActive: true,
schedule: [{startDate: '2023-11-07T05:31:56Z', endDate: '2023-11-07T05:31:56Z'}],
sponsoredBrandRejectionReason: {declineReason: '<string>', reasonDetails: '<string>'},
exclusivityPrice: 1,
impressionsThreshold: 123,
exclusivityPercentage: 123,
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>'}]
},
content: {}
})
};
fetch('https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}', 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/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Bola-Bola Ad campaign',
'isActive' => true,
'schedule' => [
[
'startDate' => '2023-11-07T05:31:56Z',
'endDate' => '2023-11-07T05:31:56Z'
]
],
'sponsoredBrandRejectionReason' => [
'declineReason' => '<string>',
'reasonDetails' => '<string>'
],
'exclusivityPrice' => 1,
'impressionsThreshold' => 123,
'exclusivityPercentage' => 123,
'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>'
]
]
],
'content' => [
]
]),
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/{campaign_id}"
payload := strings.NewReader("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/public/v1/campaign-service/campaigns/sponsored-brand/exclusive/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Bola-Bola Ad campaign\",\n \"isActive\": true,\n \"schedule\": [\n {\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"endDate\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"sponsoredBrandRejectionReason\": {\n \"declineReason\": \"<string>\",\n \"reasonDetails\": \"<string>\"\n },\n \"exclusivityPrice\": 1,\n \"impressionsThreshold\": 123,\n \"exclusivityPercentage\": 123,\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 \"content\": {}\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
Cuerpo
application/json
Request body for updating a public exclusive sponsored brand campaign.
Respuesta
Successful Response
An exclusive sponsored brand campaign returned by the public API.
¿Esta página le ayudó?