Skip to main content
POST
/
public
/
v1
/
user-service
/
advertiser-users
Create User
curl --request POST \
  --url https://api.topsort.com/public/v1/user-service/advertiser-users \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "vendorIds": [
    "<string>"
  ],
  "givenName": "",
  "familyName": "",
  "languagePreference": "en"
}
'
import requests

url = "https://api.topsort.com/public/v1/user-service/advertiser-users"

payload = {
    "email": "<string>",
    "vendorIds": ["<string>"],
    "givenName": "",
    "familyName": "",
    "languagePreference": "en"
}
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({
    email: '<string>',
    vendorIds: ['<string>'],
    givenName: '',
    familyName: '',
    languagePreference: 'en'
  })
};

fetch('https://api.topsort.com/public/v1/user-service/advertiser-users', 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/user-service/advertiser-users",
  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([
    'email' => '<string>',
    'vendorIds' => [
        '<string>'
    ],
    'givenName' => '',
    'familyName' => '',
    'languagePreference' => 'en'
  ]),
  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/user-service/advertiser-users"

	payload := strings.NewReader("{\n  \"email\": \"<string>\",\n  \"vendorIds\": [\n    \"<string>\"\n  ],\n  \"givenName\": \"\",\n  \"familyName\": \"\",\n  \"languagePreference\": \"en\"\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/user-service/advertiser-users")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"<string>\",\n  \"vendorIds\": [\n    \"<string>\"\n  ],\n  \"givenName\": \"\",\n  \"familyName\": \"\",\n  \"languagePreference\": \"en\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.topsort.com/public/v1/user-service/advertiser-users")

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  \"email\": \"<string>\",\n  \"vendorIds\": [\n    \"<string>\"\n  ],\n  \"givenName\": \"\",\n  \"familyName\": \"\",\n  \"languagePreference\": \"en\"\n}"

response = http.request(request)
puts response.read_body
{
  "email": "<string>",
  "vendorIds": [
    "<string>"
  ],
  "userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "givenName": "",
  "familyName": "",
  "languagePreference": "en"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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.

Body

application/json
email
string
required

The email address of the vendor user

Maximum string length: 255
vendorIds
string[]
required
Required array length: 1 - 1000 elements
givenName
string
default:""

The first name of the vendor user

Maximum string length: 50
familyName
string
default:""

The last name of the vendor user

Maximum string length: 50
languagePreference
enum<string>
default:en

The preferred language of the vendor user

Available options:
en,
fr,
es,
pt,
ru,
ar-AE,
de,
ko

Response

Successful Response

email
string
required

The email address of the vendor user

Maximum string length: 255
vendorIds
string[]
required
Required array length: 1 - 1000 elements
userId
string<uuid>
required

The unique identifier for the vendor user

givenName
string
default:""

The first name of the vendor user

Maximum string length: 50
familyName
string
default:""

The last name of the vendor user

Maximum string length: 50
languagePreference
enum<string>
default:en

The preferred language of the vendor user

Available options:
en,
fr,
es,
pt,
ru,
ar-AE,
de,
ko