Campaigns
Preview Campaign Personalized Lists
Preview campaign personalized lists for a subscriber
POST
/
api
/
v1
/
campaigns
/
{campaignId}
/
preview-computed-data
Preview Campaign Personalized Lists
curl --request POST \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriberId": "<string>",
"subscriber": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data"
payload = {
"subscriberId": "<string>",
"subscriber": {}
}
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({subscriberId: '<string>', subscriber: {}})
};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data', 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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data",
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([
'subscriberId' => '<string>',
'subscriber' => [
]
]),
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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data"
payload := strings.NewReader("{\n \"subscriberId\": \"<string>\",\n \"subscriber\": {}\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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscriberId\": \"<string>\",\n \"subscriber\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data")
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 \"subscriberId\": \"<string>\",\n \"subscriber\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"variables": {
"campaign": {
"events": []
},
"recommendedEvents": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
},
"lists": [
{
"key": "recommendedEvents",
"items": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
],
"exposures": [
{
"slot": 1,
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
}
]
}
{
"success": false,
"error": "Provide subscriberId or subscriber."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}
Preview the per-recipient lists that a campaign will compute from its campaign data.
Request
string
required
Campaign ID.
string
Existing subscriber ID to use for the preview. Use this or
subscriber.object
Inline preview subscriber. Use this or
subscriberId.curl -X POST "https://api.sequenzy.com/api/v1/campaigns/camp_abc123/preview-computed-data" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subscriber": {
"email": "anna@example.com",
"customAttributes": {
"region": "Auckland",
"interests": ["theatre", "arts"]
}
}
}'
Responses
{
"success": true,
"variables": {
"campaign": {
"events": []
},
"recommendedEvents": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
},
"lists": [
{
"key": "recommendedEvents",
"items": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
],
"exposures": [
{
"slot": 1,
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
}
]
}
{
"success": false,
"error": "Provide subscriberId or subscriber."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}
⌘I
Preview Campaign Personalized Lists
curl --request POST \
--url https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriberId": "<string>",
"subscriber": {}
}
'import requests
url = "https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data"
payload = {
"subscriberId": "<string>",
"subscriber": {}
}
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({subscriberId: '<string>', subscriber: {}})
};
fetch('https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data', 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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data",
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([
'subscriberId' => '<string>',
'subscriber' => [
]
]),
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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data"
payload := strings.NewReader("{\n \"subscriberId\": \"<string>\",\n \"subscriber\": {}\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.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscriberId\": \"<string>\",\n \"subscriber\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/campaigns/{campaignId}/preview-computed-data")
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 \"subscriberId\": \"<string>\",\n \"subscriber\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"variables": {
"campaign": {
"events": []
},
"recommendedEvents": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
},
"lists": [
{
"key": "recommendedEvents",
"items": [
{
"id": "evt_123",
"title": "Romeo and Juliet"
}
],
"exposures": [
{
"slot": 1,
"id": "evt_123",
"title": "Romeo and Juliet"
}
]
}
]
}
{
"success": false,
"error": "Provide subscriberId or subscriber."
}
{
"success": false,
"error": "Unauthorized"
}
{
"success": false,
"error": "Campaign not found"
}