Advanced counting of guests
curl --request POST \
--url https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"criteria": [
{
"criteria": [
{
"value": "<string>"
}
]
}
]
}
}
'const url = 'https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: {criteria: [{criteria: [{value: '<string>'}]}]}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count"
payload = { "query": { "criteria": [{ "criteria": [{ "value": "<string>" }] }] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count",
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([
'query' => [
'criteria' => [
[
'criteria' => [
[
'value' => '<string>'
]
]
]
]
]
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"query\": {\n \"criteria\": [\n {\n \"criteria\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"criteria\": [\n {\n \"criteria\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
.asString();{
"count": 123,
"accurate": true
}Search
Count guests
Count or estimate the guests matching advanced filters
POST
/
api
/
guestprofile
/
entities
/
{entity_id}
/
guests
/
count
Advanced counting of guests
curl --request POST \
--url https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": {
"criteria": [
{
"criteria": [
{
"value": "<string>"
}
]
}
]
}
}
'const url = 'https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: {criteria: [{criteria: [{value: '<string>'}]}]}})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count"
payload = { "query": { "criteria": [{ "criteria": [{ "value": "<string>" }] }] } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count",
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([
'query' => [
'criteria' => [
[
'criteria' => [
[
'value' => '<string>'
]
]
]
]
]
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"query\": {\n \"criteria\": [\n {\n \"criteria\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://{apiBaseUrl}/api/guestprofile/entities/{entity_id}/guests/count")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"criteria\": [\n {\n \"criteria\": [\n {\n \"value\": \"<string>\"\n }\n ]\n }\n ]\n }\n}")
.asString();{
"count": 123,
"accurate": true
}The fields a criterion can target, and the operators each one accepts, are listed on the Search criteria page.
Was this page helpful?