Data Query API Code Samples
Selection of code samples that demonstrate the use of the Data Query API. Copy and edit these code samples to suit your needs.
When using the code samples, remember to replace:
- {vanity_name} with your tenant name
- {api_key} with your API key
- {security_token} with a valid security token
These code samples may not include all available parameters and request body fields for each endpoint. For the endpoint's full request schema, see "Data Query" in API Reference.
Basic aggregate query
Headcount query (JSON response)
This sample request retrieves the latest 3 months of Headcount from a tenant, assuming this tenant has Headcount data up to March 1, 2024. It does not use any group bys or filters, and returns data in JSON format.
POST /v1/data/query/aggregate
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"intervalCount": 3,
"dynamicDateFrom": "SOURCE"
}
}
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
}
data = {
"query": {
"source": {"metric": "employeeCount"},
"timeIntervals": {"intervalCount": 3, "dynamicDateFrom": "SOURCE"}
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: {
source: { metric: 'employeeCount' },
timeIntervals: { intervalCount: 3, dynamicDateFrom: 'SOURCE' }
}
});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/aggregate', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
POST /v1/data/query/sql
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time, level(Function, \"Function\") FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 3, period(1, Month))"
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/sql'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
}
data = {
"query": 'SELECT employeeCount(), Visier_Time, level(Function, "Function") FROM Employee WHERE Visier_Time IN periods(date("2024-03-01"), 3, period(1, Month))'
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: 'SELECT employeeCount(), Visier_Time, level(Function, "Function") FROM Employee WHERE Visier_Time IN periods(date("2024-03-01"), 3, period(1, Month))'});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/sql', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
{
"cells": [
{
"value": "4071",
"support": "4071",
"coordinates": [
0,
0
]
},
{
"value": "4068",
"support": "4068",
"coordinates": [
0,
1
]
},
{
"value": "4030",
"support": "4030",
"coordinates": [
0,
2
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-01-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [0]"
]
}
]
}
]
}
Headcount query (text/csv response)
This sample request retrieves the latest 3 months of Headcount from a tenant, assuming this tenant has Headcount data up to March 1, 2024. It does not use any group bys or filters, and returns data in text/csv format.
POST /v1/data/query/aggregate
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: text/csv;application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"intervalCount": 3,
"dynamicDateFrom": "SOURCE"
}
}
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json',
'Accept': 'text/csv;application/json'
}
data = {
"query": {
"source": {"metric": "employeeCount"},
"timeIntervals": {"intervalCount": 3, "dynamicDateFrom": "SOURCE"}
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: {
source: { metric: 'employeeCount' },
timeIntervals: { intervalCount: 3, dynamicDateFrom: 'SOURCE' }
}
});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/aggregate', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json',
'Accept': 'text/csv;application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
Measures,DateInRange
4071.0,2024-01-01T00:00:00.000Z
4030.0,2024-03-01T00:00:00.000Z
4068.0,2024-02-01T00:00:00.000Z
Aggregate query with filters
Headcount query filtered by Permanent employees
This sample request retrieves the latest 3 months of Headcount filtered by Permanent employees from a tenant, assuming this tenant has Headcount data up to March 1, 2024. The data is grouped by Function.
POST /v1/data/query/aggregate
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"intervalCount": 3,
"dynamicDateFrom": "SOURCE"
},
"filters": [{
"memberSet": {
"dimension": {
"name": "Permanent",
"qualifyingPath": "Employee"
},
"values": {
"included": [{
"path": ["True"]
}]
}
}
}],
"axes": [
{
"dimensionLevelSelection": {
"dimension": {
"name": "Function",
"qualifyingPath": "Employee"
},
"levelIds": [
"Function"
]
}
}
]
}
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
}
data = {
"query": {
"source": {"metric": "employeeCount"},
"timeIntervals": {"intervalCount": 3, "dynamicDateFrom": "SOURCE"},
"filters": [{
"memberSet": {
"dimension": {
"name": "Permanent",
"qualifyingPath": "Employee"
},
"values": {
"included": [{"path
: ["True"]}]
}
}
}],
"axes": [{
"dimensionLevelSelection": {
"dimension": {
"name": "Function",
"qualifyingPath": "Employee"
},
"levelIds": ["Function"]
}
}]
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: {
source: { metric: 'employeeCount' },
timeIntervals: { intervalCount: 3, dynamicDateFrom: 'SOURCE' },
filters: [{
memberSet: {
dimension: {
name: 'Permanent',
qualifyingPath: 'Employee'
},
values: {
included: [{ path: ['True'] }]
}
}
}],
axes: [{
dimensionLevelSelection: {
dimension: {
name: 'Function',
qualifyingPath: 'Employee'
},
levelIds: ['Function']
}
}]
}
});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/aggregate', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
POST /v1/data/query/sql
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time, level(Function, \"Function\") FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 3, period(1, Month)) AND Permanent IN (\"True\")"
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/sql'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
}
data = {
"query": 'SELECT employeeCount(), Visier_Time, level(Function, "Function") FROM Employee WHERE Visier_Time IN periods(date("2024-03-01"), 3, period(1, Month)) AND Permanent IN ("True")'
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: 'SELECT employeeCount(), Visier_Time, level(Function, "Function") FROM Employee WHERE Visier_Time IN periods(date("2024-03-01"), 3, period(1, Month)) AND Permanent IN ("True")'
});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/sql', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
{
"cells": [
{
"value": "1420",
"support": "1420",
"coordinates": [
0,
0
]
},
{
"value": "1580",
"support": "1580",
"coordinates": [
0,
1
]
},
{
"value": "1520",
"support": "1520",
"coordinates": [
0,
2
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-01-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [0]"
]
}
]
}
]
}
Aggregate queries with trailing time
Employee Exit Rate query with 2 months trailing time
This sample request retrieves the latest 2 periods of Exit Rate from a tenant, assuming this tenant has Exit Rate data up to March 1, 2024. Each period has 3 months trailing time. It does not use any group bys or filters.
POST /v1/data/query/aggregate
- curl
- Python
- Node.js
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "Exit_Model.Rate.Exit"
},
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalCount": 2,
"trailingPeriodType": "MONTH",
"trailingPeriodCount": 3
}
}
}'
import requests
import json
url = 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate'
headers = {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
}
data = {
"query": {
"source": {"metric": "Exit_Model.Rate.Exit"},
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalCount": 2,
"trailingPeriodType": "MONTH",
"trailingPeriodCount": 3
}
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
const fetch = require('node-fetch');
const data = JSON.stringify({
query: {
source: { metric: 'Exit_Model.Rate.Exit' },
timeIntervals: {
dynamicDateFrom: 'SOURCE',
intervalCount: 2,
trailingPeriodType: 'MONTH',
trailingPeriodCount: 3
}
}
});
fetch('https://{vanity_name}.api.visier.io/v1/data/query/aggregate', {
method: 'POST',
headers: {
'apikey': '{api_key}',
'Cookie': 'VisierASIDToken={security_token}',
'Content-Type': 'application/json'
},
body: data
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error('Error:', error));
{
"cells": [
{
"value": "0.15906009941256213",
"support": "528",
"coordinates": [
0,
0
]
},
{
"value": "0.1480026822492576",
"support": "515",
"coordinates": [
0,
1
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "TimeInInterval",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2023-11-01T00:00:00.000Z/2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2023-12-01T00:00:00.000Z/2024-03-01T00:00:00.000Z - [1]"
]
}
]
}
]
}
Employee Exit Rate query with 6 months forward trailing time
This sample request retrieves the earliest 2 periods of Exit Rate from a tenant, assuming this tenant has Exit Rate data starting from March 1, 2024. Each period has 6 months trailing time. It does not use any group bys or filters.
POST /v1/data/query/aggregate
cURL sample request with JSON body
cURL sample request with JSON bodycurl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "Exit_Model.Rate.Exit"
},
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalCount": 2,
"direction": "FORWARD",
"trailingPeriodType": "MONTH",
"trailingPeriodCount": 6
}
}
}'
{
"cells": [
{
"value": "0.22863198050227826",
"support": "899",
"coordinates": [
0,
0
]
},
{
"value": "0.2181540484928194",
"support": "857",
"coordinates": [
0,
1
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "TimeInInterval",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-03-01T00:00:00.000Z/2024-09-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-04-01T00:00:00.000Z/2024-10-01T00:00:00.000Z - [1]"
]
}
]
}
]
}
Headcount query filtered by Women employees
This sample request retrieves the latest 3 months of Headcount filtered by Women employees from a tenant, assuming this tenant has Headcount data up to March 1, 2024. It does not use a group by.
POST /v1/data/query/aggregate
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"intervalCount": 3,
"dynamicDateFrom": "SOURCE"
},
"filters": [{
"selectionConcept": {
"name": "isFemale",
"qualifyingPath": "Employee"
}
}]
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 3, period(1, Month)) AND isFemale = TRUE"
}'
{
"cells": [
{
"value": "1420",
"support": "1420",
"coordinates": [
0,
0
]
},
{
"value": "1580",
"support": "1580",
"coordinates": [
0,
1
]
},
{
"value": "1520",
"support": "1520",
"coordinates": [
0,
2
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-01-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [0]"
]
}
]
}
]
}
Headcount query filtered by Direct Manager
This sample request retrieves the latest 3 months of Headcount filtered by Direct Manager from a tenant, assuming this tenant has Exit Rate data up to March 1, 2024. It does not use any group bys.
POST /v1/data/query/aggregate
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"intervalCount": 3,
"dynamicDateFrom": "SOURCE"
},
"filters": [{
"memberSet": {
"dimension": {
"name": "Permanent",
"qualifyingPath": "Employee.Direct_Manager"
},
"values": {
"included": [{
"path": ["True"]
}]
}
}
}]
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 3, period(1, Month)) AND Direct_Manager.Permanent IN (\"True\")"
}'
{
"cells": [
{
"value": "3282",
"support": "3282",
"coordinates": [
0,
0
]
},
{
"value": "3242",
"support": "3242",
"coordinates": [
0,
1
]
},
{
"value": "3255",
"support": "3255",
"coordinates": [
0,
2
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-01-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [0]"
]
}
]
}
]
}
Aggregate query for multiple periods
Headcount query for 4 time periods
This sample request retrieves the latest 4 quarters of Headcount from a tenant, assuming this tenant has Headcount data up to March 1, 2024. It does not use any group bys or filters.
POST /v1/data/query/aggregate
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalPeriodType": "QUARTER",
"intervalCount": 4
}
}
}`
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 4, period(1, Quarter))"
}'
{
"cells": [
{
"value": "3829",
"support": "3829",
"coordinates": [
0,
0
]
},
{
"value": "3736",
"support": "3736",
"coordinates": [
0,
1
]
},
{
"value": "3620",
"support": "3620",
"coordinates": [
0,
2
]
},
{
"value": "4071",
"support": "4071",
"coordinates": [
0,
3
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2023-07-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2023-10-01T00:00:00.000Z - [1]"
]
},
{
"path": [
"2024-01-01T00:00:00.000Z - [2]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [3]"
]
}
]
}
]
}
Aggregate query with groupings
Headcount query grouped by Job Function and Pay Level
This sample request retrieves the latest 3 months of Headcount grouped by Job Function and Pay Level from a tenant, assuming this tenant has Headcount data up to March 1, 2024.
POST /v1/data/query/aggregate
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "employeeCount"
},
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalCount": 3
},
"axes": [{
"dimensionLevelSelection": {
"dimension": {
"name": "Function",
"qualifyingPath": "Employee"
},
"levelIds": [
"Function"
]
}
}, {
"dimensionLevelSelection": {
"dimension": {
"name": "Pay_Level",
"qualifyingPath": "Employee"
},
"levelIds": [
"Pay_Level"
]
}
}]
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT employeeCount(), Visier_Time, level(Function, \"Function\"), level(Pay_Level, \"Pay_Level\") FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 3, period(1, Month))"
}'
{
"cells": [
{
"value": "4071",
"support": "4071",
"coordinates": [
0,
0
]
},
{
"value": "4021",
"support": "4021",
"coordinates": [
0,
1
]
},
{
"value": "4156",
"support": "4156",
"coordinates": [
0,
2
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "DateInRange",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2024-01-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-02-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2024-03-01T00:00:00.000Z - [0]"
]
}
]
}
]
}
Aggregate query with parameters
Days Worked Over Maximum Consecutive Limit query with the Maximum Consecutive Working Days Limit parameter set to 1
This sample request retrieves the latest 4 intervals each containing 3 months of data for Days Worked Over Maximum Consecutive Limit from a tenant, assuming this tenant has Days Worked Over Maximum Consecutive Limit data up to March 1, 2024, with the Maximum Consecutive Working Days Limit parameter set to 1. Some metrics use parameters (dynamic values) in their formulas that allow you to change how the metric is calculated. In this example, you can change the parameter to set the maximum number of consecutive days an employee is able to work. Working streaks that exceed this limit during the period will be included in the calculation. It does not use any group bys or filters.
POST /v1/data/query/aggregate
JSON sample request body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/aggregate' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": {
"source": {
"metric": "daysWorkedOverMaxConsecutiveLimit"
},
"parameterValues": [{
"numericValue": {
"parameterId": "daysWorkedOverMaxConsecutiveLimit.Max_Consecutive_Working_Days_Limit_Parameter",
"value": 1
}
}],
"timeIntervals": {
"dynamicDateFrom": "SOURCE",
"intervalPeriodCount": 3,
"intervalCount": 4
}
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT daysWorkedOverMaxConsecutiveLimit(Max_Consecutive_Working_Days_Limit_Parameter = 1), Visier_Time FROM Employee WHERE Visier_Time IN periods(date(\"2024-03-01\"), 4, period(3, Month))"
}'
{
"cells": [
{
"value": "14283",
"support": "19017",
"coordinates": [
0,
0
]
},
{
"value": "14275",
"support": "14275",
"coordinates": [
0,
1
]
},
{
"value": "13653",
"support": "13653",
"coordinates": [
0,
2
]
},
{
"value": "14750",
"support": "24009",
"coordinates": [
0,
3
]
}
],
"axes": [
{
"dimension": {
"name": "Measures",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"MeasureName"
]
}
]
},
{
"dimension": {
"name": "TimeInInterval",
"qualifyingPath": ""
},
"positions": [
{
"path": [
"2023-03-01T00:00:00.000Z/2023-06-01T00:00:00.000Z - [0]"
]
},
{
"path": [
"2023-06-01T00:00:00.000Z/2023-09-01T00:00:00.000Z - [1]"
]
},
{
"path": [
"2023-09-01T00:00:00.000Z/2023-12-01T00:00:00.000Z - [2]"
]
},
{
"path": [
"2023-12-01T00:00:00.000Z/2024-03-01T00:00:00.000Z - [3]"
]
}
]
}
]
}
Basic list query
List query for Employee first name, last name, and organization
This sample request retrieves the latest employee data for the employees' first names, last names, and organizations from a tenant, assuming this tenant has Employee data up to March 1, 2024. It does not use any group bys or filters.
POST /v1/data/query/list
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/list' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"source": {
"analyticObject": "Employee"
},
"columns": [{
"columnName": "First Name",
"columnDefinition": {
"property": {
"name": "Employee.First_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Last Name",
"columnDefinition": {
"property": {
"name": "Employee.Last_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Organization",
"columnDefinition": {
"dimension": {
"name": "Organization_Hierarchy",
"qualifyingPath": "Employee"
}
}
}],
"timeInterval": {
"dynamicDateFrom": "SOURCE"
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '
{
"query": "SELECT Employee.First_Name, Employee.Last_Name, Organization_Hierarchy FROM Employee WHERE Visier_Time BETWEEN date(\"2024-02-01\") AND date(\"2024-03-01\")"
}`
{
"header": {
"0": "First Name",
"1": "Last Name",
"2": "Organization"
},
"rows": [
{
"0": "Cayson Keegan",
"1": "Hilliard",
"2": "-1;Marketing;Field Marketing;South Field Marketing"
},
{
"0": "David Ashton",
"1": "Cordova",
"2": "-1;Marketing;Advertising;Contract Management"
},
{
"0": "Edith Zoie",
"1": "Mccullough",
"2": "-1;Customer Support;NA Customer Support;East Call Center"
}
]
}
List query with filters and sorting
List query for Employee first name, last name, and organization filtered by Woman
This sample request retrieves the latest data for women employees' first names, last names, and organizations from a tenant, assuming this tenant has Employee data up to March 1, 2024. It does not use any group bys. The result is sorted by first name and then last name.
POST /v1/data/query/list
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/list' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"source": {
"analyticObject": "Employee"
},
"filters": [{
"selectionConcept": {
"name": "isFemale",
"qualifyingPath": "Employee"
}
}],
"columns": [{
"columnName": "First Name",
"columnDefinition": {
"property": {
"name": "Employee.First_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Last Name",
"columnDefinition": {
"property": {
"name": "Employee.Last_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Organization",
"columnDefinition": {
"dimension": {
"name": "Organization_Hierarchy",
"qualifyingPath": "Employee"
}
}
}],
"sortOptions": [
{
"columnIndex": 0,
"sortDirection": "SORT_ASCENDING"
},
{
"columnIndex": 1,
"sortDirection": "SORT_ASCENDING"
}],
"timeInterval": {
"dynamicDateFrom": "SOURCE"
}
}'
POST /v1/data/query/sql
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/sql' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"query": "SELECT Employee.First_Name, Employee.Last_Name, Organization_Hierarchy FROM Employee WHERE Visier_Time BETWEEN date(\"2024-02-01\") AND date(\"2024-03-01\") AND isFemale = TRUE"
}'
{
"header": {
"0": "First Name",
"1": "Last Name",
"2": "Organization"
},
"rows": [
{
"0": "Edith Zoie",
"1": "Mccullough",
"2": "-1;Customer Support;NA Customer Support;East Call Center"
},
{
"0": "America Simeen",
"1": "Rodgers",
"2": "-1;Customer Support;NA Customer Support;NE Call Center"
}
]
}
List query for Employee first name, last name, and organization filtered by HR
This sample request retrieves the latest data for HR employees' first names, last names, and organizations from a tenant, assuming this tenant has Employee data up to March 1, 2024. It does not use any group bys. The result is sorted by first name and then last name.
POST /v1/data/query/list
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/list' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"source": {
"analyticObject": "Employee"
},
"filters": [{
"formula": "include(Employee.Organization_Hierarchy, list(list(\"HR\")))"
}],
"columns": [{
"columnName": "First Name",
"columnDefinition": {
"property": {
"name": "Employee.First_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Last Name",
"columnDefinition": {
"property": {
"name": "Employee.Last_Name",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "Organization",
"columnDefinition": {
"dimension": {
"name": "Organization_Hierarchy",
"qualifyingPath": "Employee"
}
}
}],
"sortOptions": [
{
"columnIndex": 0,
"sortDirection": "SORT_ASCENDING"
},
{
"columnIndex": 1,
"sortDirection": "SORT_ASCENDING"
}],
"timeInterval": {
"dynamicDateFrom": "SOURCE"
}
}'
{
"header": {
"0": "First Name",
"1": "Last Name",
"2": "Organization"
},
"rows": [
{
"0": "Phil Kruz",
"1": "Lemon",
"2": "-1;HR;HR West"
},
{
"0": "Orpah Shelby",
"1": "Vina",
"2": "-1;HR;HR North East"
},
{
"0": "Braedan Daiki",
"1": "Lacerda",
"2": "-1;HR;HR South"
}
]
}
Multi-value property list query
Multi-value property query for employee compensation items
This sample request retrieves the latest data for compensation items, the employee ID of the employee who is being compensated, the compensation type, and the compensation amount from a tenant, assuming this tenant has employee compensation data up to March 1, 2024. It does not use any group bys or filters.
POST /v1/data/query/list
cURL sample request with JSON body
curl -X POST --url 'https://{vanity_name}.api.visier.io/v1/data/query/list' \
-H 'apikey:{api_key}' \
-H 'Cookie:VisierASIDToken={security_token}' \
-H 'Content-Type: application/json' \
--data '{
"source": {
"analyticObject": "Employee.Employee_Budgeted_Compensation"
},
"columns": [{
"columnName": "Employee.Employee.EmployeeID",
"columnDefinition": {
"property": {
"name": "Employee.EmployeeID",
"qualifyingPath": "Employee"
}
}
}, {
"columnName": "compensationType",
"columnDefinition": {
"formula": "Compensation_Type"
}
},
{
"columnName": "compensationAmount",
"columnDefinition": {
"formula": "Employee_Budgeted_Compensation.Compensation_Amount"
}
}],
"timeInterval": {
"dynamicDateFrom": "SOURCE"
}
}'
{
"header": {
"0": "Employee.Employee.EmployeeID",
"1": "compensationType",
"2": "compensationAmount"
},
"rows": [
{
"0": "Employee-26833151",
"1": "Agency_Staff",
"2": 3140.17
},
{
"0": "Employee-26833151",
"1": "Facilities",
"2": 3140.17
},
{
"0": "Employee-26833151",
"1": "Health Plan 3",
"2": 3140.17
}
]
}