curl --request POST \
--url https://api.topsort.com/v2/auctions/sponsored-brand \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auctions": [
{
"winners": 2,
"placementId": "some-placement",
"triggers": {
"products": {
"ids": [
"vanilla_yogurt"
]
}
}
}
]
}
'import requests
url = "https://api.topsort.com/v2/auctions/sponsored-brand"
payload = { "auctions": [
{
"winners": 2,
"placementId": "some-placement",
"triggers": { "products": { "ids": ["vanilla_yogurt"] } }
}
] }
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({
auctions: [
{
winners: 2,
placementId: 'some-placement',
triggers: {products: {ids: ['vanilla_yogurt']}}
}
]
})
};
fetch('https://api.topsort.com/v2/auctions/sponsored-brand', 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/v2/auctions/sponsored-brand",
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([
'auctions' => [
[
'winners' => 2,
'placementId' => 'some-placement',
'triggers' => [
'products' => [
'ids' => [
'vanilla_yogurt'
]
]
]
]
]
]),
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/v2/auctions/sponsored-brand"
payload := strings.NewReader("{\n \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\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/v2/auctions/sponsored-brand")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/v2/auctions/sponsored-brand")
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 \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"resultType": "brand",
"winners": [
{
"rank": 1,
"type": "product",
"id": "brand-123",
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"content": {
"headline": "Topsort Rocks",
"brandName": "Topsort Brand"
}
}
],
"error": false
}
]
}{
"docUrl": "<string>",
"message": "<string>"
}Create sponsored brand auctions
curl --request POST \
--url https://api.topsort.com/v2/auctions/sponsored-brand \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"auctions": [
{
"winners": 2,
"placementId": "some-placement",
"triggers": {
"products": {
"ids": [
"vanilla_yogurt"
]
}
}
}
]
}
'import requests
url = "https://api.topsort.com/v2/auctions/sponsored-brand"
payload = { "auctions": [
{
"winners": 2,
"placementId": "some-placement",
"triggers": { "products": { "ids": ["vanilla_yogurt"] } }
}
] }
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({
auctions: [
{
winners: 2,
placementId: 'some-placement',
triggers: {products: {ids: ['vanilla_yogurt']}}
}
]
})
};
fetch('https://api.topsort.com/v2/auctions/sponsored-brand', 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/v2/auctions/sponsored-brand",
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([
'auctions' => [
[
'winners' => 2,
'placementId' => 'some-placement',
'triggers' => [
'products' => [
'ids' => [
'vanilla_yogurt'
]
]
]
]
]
]),
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/v2/auctions/sponsored-brand"
payload := strings.NewReader("{\n \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\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/v2/auctions/sponsored-brand")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topsort.com/v2/auctions/sponsored-brand")
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 \"auctions\": [\n {\n \"winners\": 2,\n \"placementId\": \"some-placement\",\n \"triggers\": {\n \"products\": {\n \"ids\": [\n \"vanilla_yogurt\"\n ]\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"resultType": "brand",
"winners": [
{
"rank": 1,
"type": "product",
"id": "brand-123",
"resolvedBidId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=",
"content": {
"headline": "Topsort Rocks",
"brandName": "Topsort Brand"
}
}
],
"error": false
}
]
}{
"docUrl": "<string>",
"message": "<string>"
}Autorisations
A valid API key generated in Topsort's UI. Use a TSE API key for calls to Auctions or Events API.
Corps
The information describing what will be auctioned. Topsort will run an auction for each batched auction request, for which products bids will compete against each other.
1 - 5 elementsShow child attributes
Show child attributes
[
{
"winners": 2,
"placementId": "some-placement",
"triggers": { "products": { "ids": ["vanilla_yogurt"] } }
}
]
Réponse
The sponsored brand auction results. The list of winners will contain at most winners entries per auction. It may contain fewer or no entries at all if there aren't enough products with usable bids, that is, a bid amount greater than the reserve price and belonging to a campaign with enough remaining budget. Bids become unusable if campaign budget is exhausted, the bid is disqualified to preserve spend pacing, etc.
1 - 5 elementsShow child attributes
Show child attributes
[
{
"resultType": "brand",
"winners": [],
"error": false
}
]
Cette page vous a-t-elle été utile ?