Server-side personalization request
curl --request POST \
--url https://api-eu-w-1.pureclarity.net/api/serverside \
--header 'Content-Type: application/json' \
--data '
{
"appId": "your-access-key",
"secretKey": "your-secret-key",
"currentUrl": "https://www.example.com/products/shoes",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"ip": "203.0.113.50",
"currency": "GBP",
"events": [
{
"name": "page_view",
"data": {
"page_type": "product_page"
}
},
{
"name": "product_view",
"data": {
"id": "PROD-001"
}
}
],
"zones": [
"HP-01",
"PP-01"
]
}
'import requests
url = "https://api-eu-w-1.pureclarity.net/api/serverside"
payload = {
"appId": "your-access-key",
"secretKey": "your-secret-key",
"currentUrl": "https://www.example.com/products/shoes",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"ip": "203.0.113.50",
"currency": "GBP",
"events": [
{
"name": "page_view",
"data": { "page_type": "product_page" }
},
{
"name": "product_view",
"data": { "id": "PROD-001" }
}
],
"zones": ["HP-01", "PP-01"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 'your-access-key',
secretKey: 'your-secret-key',
currentUrl: 'https://www.example.com/products/shoes',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
ip: '203.0.113.50',
currency: 'GBP',
events: [
{name: 'page_view', data: {page_type: 'product_page'}},
{name: 'product_view', data: {id: 'PROD-001'}}
],
zones: ['HP-01', 'PP-01']
})
};
fetch('https://api-eu-w-1.pureclarity.net/api/serverside', 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-eu-w-1.pureclarity.net/api/serverside",
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([
'appId' => 'your-access-key',
'secretKey' => 'your-secret-key',
'currentUrl' => 'https://www.example.com/products/shoes',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
'ip' => '203.0.113.50',
'currency' => 'GBP',
'events' => [
[
'name' => 'page_view',
'data' => [
'page_type' => 'product_page'
]
],
[
'name' => 'product_view',
'data' => [
'id' => 'PROD-001'
]
]
],
'zones' => [
'HP-01',
'PP-01'
]
]),
CURLOPT_HTTPHEADER => [
"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-eu-w-1.pureclarity.net/api/serverside"
payload := strings.NewReader("{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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-eu-w-1.pureclarity.net/api/serverside")
.header("Content-Type", "application/json")
.body("{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu-w-1.pureclarity.net/api/serverside")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"visitorId": "abc123-visitor-id",
"sessionId": "xyz789-session-id",
"zones": {
"HP-01": {
"title": "Recommended for you",
"type": "recommender-product",
"items": [
{
"Id": "PROD-001",
"Title": "Running Shoes",
"Price": 59.99,
"Link": "/products/running-shoes",
"Image": "https://cdn.example.com/shoes.jpg"
}
]
}
}
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}Server-side
Server-side personalization request
Submit tracking events and retrieve personalized zone content from the server side. This endpoint combines event tracking with zone content retrieval in a single request, making it suitable for server-side rendered applications.
Visitor and session IDs should be persisted as cookies on the end user’s browser:
pc_v_{access_key}for the visitor IDpc_sessid_{access_key}for the session ID
POST
/
api
/
serverside
Server-side personalization request
curl --request POST \
--url https://api-eu-w-1.pureclarity.net/api/serverside \
--header 'Content-Type: application/json' \
--data '
{
"appId": "your-access-key",
"secretKey": "your-secret-key",
"currentUrl": "https://www.example.com/products/shoes",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"ip": "203.0.113.50",
"currency": "GBP",
"events": [
{
"name": "page_view",
"data": {
"page_type": "product_page"
}
},
{
"name": "product_view",
"data": {
"id": "PROD-001"
}
}
],
"zones": [
"HP-01",
"PP-01"
]
}
'import requests
url = "https://api-eu-w-1.pureclarity.net/api/serverside"
payload = {
"appId": "your-access-key",
"secretKey": "your-secret-key",
"currentUrl": "https://www.example.com/products/shoes",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"ip": "203.0.113.50",
"currency": "GBP",
"events": [
{
"name": "page_view",
"data": { "page_type": "product_page" }
},
{
"name": "product_view",
"data": { "id": "PROD-001" }
}
],
"zones": ["HP-01", "PP-01"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 'your-access-key',
secretKey: 'your-secret-key',
currentUrl: 'https://www.example.com/products/shoes',
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
ip: '203.0.113.50',
currency: 'GBP',
events: [
{name: 'page_view', data: {page_type: 'product_page'}},
{name: 'product_view', data: {id: 'PROD-001'}}
],
zones: ['HP-01', 'PP-01']
})
};
fetch('https://api-eu-w-1.pureclarity.net/api/serverside', 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-eu-w-1.pureclarity.net/api/serverside",
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([
'appId' => 'your-access-key',
'secretKey' => 'your-secret-key',
'currentUrl' => 'https://www.example.com/products/shoes',
'userAgent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
'ip' => '203.0.113.50',
'currency' => 'GBP',
'events' => [
[
'name' => 'page_view',
'data' => [
'page_type' => 'product_page'
]
],
[
'name' => 'product_view',
'data' => [
'id' => 'PROD-001'
]
]
],
'zones' => [
'HP-01',
'PP-01'
]
]),
CURLOPT_HTTPHEADER => [
"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-eu-w-1.pureclarity.net/api/serverside"
payload := strings.NewReader("{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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-eu-w-1.pureclarity.net/api/serverside")
.header("Content-Type", "application/json")
.body("{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu-w-1.pureclarity.net/api/serverside")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"appId\": \"your-access-key\",\n \"secretKey\": \"your-secret-key\",\n \"currentUrl\": \"https://www.example.com/products/shoes\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64)\",\n \"ip\": \"203.0.113.50\",\n \"currency\": \"GBP\",\n \"events\": [\n {\n \"name\": \"page_view\",\n \"data\": {\n \"page_type\": \"product_page\"\n }\n },\n {\n \"name\": \"product_view\",\n \"data\": {\n \"id\": \"PROD-001\"\n }\n }\n ],\n \"zones\": [\n \"HP-01\",\n \"PP-01\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"visitorId": "abc123-visitor-id",
"sessionId": "xyz789-session-id",
"zones": {
"HP-01": {
"title": "Recommended for you",
"type": "recommender-product",
"items": [
{
"Id": "PROD-001",
"Title": "Running Shoes",
"Price": 59.99,
"Link": "/products/running-shoes",
"Image": "https://cdn.example.com/shoes.jpg"
}
]
}
}
}{
"errors": [
"<string>"
]
}{
"errors": [
"<string>"
]
}Body
application/json
Response
Successful response with personalized zone content
