cURL
# Export KINTRA_API for your environment first; the base URL is on the introduction page.
KEY="YOUR_TENANT_KEY_ID"
SECRET="YOUR_SIGNING_SECRET"
# The signature covers the path and query exactly as sent, so both are split
# off the base URL and reused for the request line below.
API_PATH="/${KINTRA_API#*://*/}"
API_HOST="${KINTRA_API%"$API_PATH"}"
METHOD="GET"
PATH_AND_QUERY="$API_PATH/gateway/customers/analytics/top-countries"
# No body on this method, so the signature covers an empty body string.
BODY=''
TIMESTAMP="$(date +%s)"
SIGNATURE="$(printf '%s' "$TIMESTAMP$METHOD$PATH_AND_QUERY$BODY" \
| openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')"
curl -sS -w '\n%{http_code}' -X "$METHOD" "$API_HOST$PATH_AND_QUERY" \
-H "X-Tenant-Key: $KEY" \
-H "X-Tenant-Timestamp: $TIMESTAMP" \
-H "X-Tenant-Signature: $SIGNATURE"const options = {
method: 'GET',
headers: {
'X-Tenant-Signature': '<x-tenant-signature>',
'X-Tenant-Timestamp': '<x-tenant-timestamp>',
'x-tenant-key': '<api-key>'
}
};
fetch('https://api.kintra.io/api/v1/gateway/customers/analytics/top-countries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kintra.io/api/v1/gateway/customers/analytics/top-countries"
headers = {
"X-Tenant-Signature": "<x-tenant-signature>",
"X-Tenant-Timestamp": "<x-tenant-timestamp>",
"x-tenant-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"data": {
"items": [
{
"active_fans_count": 123,
"country": {
"code": "<string>",
"icon_url": "<string>",
"id": "<string>",
"name": "<string>"
},
"share_of_tenant_customers_percent": 123
}
],
"tenant_id": "<string>",
"total_active_tenant_customers": 123
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}Analytics
List top countries by customer count
Ranks countries by how many of your active customers are in them, using the country set through the customer country route. The response data carries items alongside tenant_id and total_active_tenant_customers. A customer with no country set counts toward the total but ranks under no country. Returns 404 when the tenant behind the API key cannot be found.
GET
/
gateway
/
customers
/
analytics
/
top-countries
cURL
# Export KINTRA_API for your environment first; the base URL is on the introduction page.
KEY="YOUR_TENANT_KEY_ID"
SECRET="YOUR_SIGNING_SECRET"
# The signature covers the path and query exactly as sent, so both are split
# off the base URL and reused for the request line below.
API_PATH="/${KINTRA_API#*://*/}"
API_HOST="${KINTRA_API%"$API_PATH"}"
METHOD="GET"
PATH_AND_QUERY="$API_PATH/gateway/customers/analytics/top-countries"
# No body on this method, so the signature covers an empty body string.
BODY=''
TIMESTAMP="$(date +%s)"
SIGNATURE="$(printf '%s' "$TIMESTAMP$METHOD$PATH_AND_QUERY$BODY" \
| openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}')"
curl -sS -w '\n%{http_code}' -X "$METHOD" "$API_HOST$PATH_AND_QUERY" \
-H "X-Tenant-Key: $KEY" \
-H "X-Tenant-Timestamp: $TIMESTAMP" \
-H "X-Tenant-Signature: $SIGNATURE"const options = {
method: 'GET',
headers: {
'X-Tenant-Signature': '<x-tenant-signature>',
'X-Tenant-Timestamp': '<x-tenant-timestamp>',
'x-tenant-key': '<api-key>'
}
};
fetch('https://api.kintra.io/api/v1/gateway/customers/analytics/top-countries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kintra.io/api/v1/gateway/customers/analytics/top-countries"
headers = {
"X-Tenant-Signature": "<x-tenant-signature>",
"X-Tenant-Timestamp": "<x-tenant-timestamp>",
"x-tenant-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"data": {
"items": [
{
"active_fans_count": 123,
"country": {
"code": "<string>",
"icon_url": "<string>",
"id": "<string>",
"name": "<string>"
},
"share_of_tenant_customers_percent": 123
}
],
"tenant_id": "<string>",
"total_active_tenant_customers": 123
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}Authorizations
Tenant API key
Headers
Hex HMAC-SHA256 of the timestamp, the uppercase method, the url as sent and the request body, keyed by the signing secret.
Unix seconds. Checked before the signature.
⌘I

