curl --request POST \
--url https://{host}/audience/v1/audiences \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"authorName": "<string>",
"description": "<string>",
"destinations": [
"<string>"
],
"membersToAddUrl": "<string>",
"membersToAdd": [
"<string>"
],
"isPrivate": true,
"source": "<string>",
"metadata": {}
}
'import requests
url = "https://{host}/audience/v1/audiences"
payload = {
"name": "<string>",
"authorName": "<string>",
"description": "<string>",
"destinations": ["<string>"],
"membersToAddUrl": "<string>",
"membersToAdd": ["<string>"],
"isPrivate": True,
"source": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
authorName: '<string>',
description: '<string>',
destinations: ['<string>'],
membersToAddUrl: '<string>',
membersToAdd: ['<string>'],
isPrivate: true,
source: '<string>',
metadata: {}
})
};
fetch('https://{host}/audience/v1/audiences', 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://{host}/audience/v1/audiences",
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' => '<string>',
'authorName' => '<string>',
'description' => '<string>',
'destinations' => [
'<string>'
],
'membersToAddUrl' => '<string>',
'membersToAdd' => [
'<string>'
],
'isPrivate' => true,
'source' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{host}/audience/v1/audiences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{host}/audience/v1/audiences")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/audience/v1/audiences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"audienceId": "<string>",
"audienceExecutionId": "<string>",
"audienceName": "<string>"
}{
"name": "<string>",
"message": "<string>",
"details": null
}curl --request POST \
--url https://{host}/audience/v1/audiences \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"authorName": "<string>",
"description": "<string>",
"destinations": [
"<string>"
],
"membersToAddUrl": "<string>",
"membersToAdd": [
"<string>"
],
"isPrivate": true,
"source": "<string>",
"metadata": {}
}
'import requests
url = "https://{host}/audience/v1/audiences"
payload = {
"name": "<string>",
"authorName": "<string>",
"description": "<string>",
"destinations": ["<string>"],
"membersToAddUrl": "<string>",
"membersToAdd": ["<string>"],
"isPrivate": True,
"source": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
authorName: '<string>',
description: '<string>',
destinations: ['<string>'],
membersToAddUrl: '<string>',
membersToAdd: ['<string>'],
isPrivate: true,
source: '<string>',
metadata: {}
})
};
fetch('https://{host}/audience/v1/audiences', 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://{host}/audience/v1/audiences",
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' => '<string>',
'authorName' => '<string>',
'description' => '<string>',
'destinations' => [
'<string>'
],
'membersToAddUrl' => '<string>',
'membersToAdd' => [
'<string>'
],
'isPrivate' => true,
'source' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://{host}/audience/v1/audiences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://{host}/audience/v1/audiences")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/audience/v1/audiences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"authorName\": \"<string>\",\n \"description\": \"<string>\",\n \"destinations\": [\n \"<string>\"\n ],\n \"membersToAddUrl\": \"<string>\",\n \"membersToAdd\": [\n \"<string>\"\n ],\n \"isPrivate\": true,\n \"source\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"audienceId": "<string>",
"audienceExecutionId": "<string>",
"audienceName": "<string>"
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Body
The name of the audience. It should be unique.
255Name of the user who creates the audience
64Full description of the audience. Optional.
Collection of destinations the audience is applicable for (can be used in) It is the list of products which should have access to the audience.
Draft, Published, Archived Link on the file which contains the list of the customers to add.
The list of customers to add to the audience. Max length of member identifier is 64 symbols.
If true - the audience can be used only by the author.
Creation source of the audience (the list is defined in appsettings and infrastructure config)
255Represents dynamic key-value pairs for storing audience properties.
Show child attributes
Show child attributes