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

Copy
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"
        }
    }
}'
Copy
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())
Copy
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

Copy
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))"
}'
Copy
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())
Copy
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));

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

Copy
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"
        }
    }
}'
Copy
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())
Copy
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));

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

Copy
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"
                    ]
                }
            }
        ]
    }
}'
Copy
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())
Copy
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

Copy
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\")"
}'
Copy
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())
Copy
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));

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

Copy
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
        }
    }
}'
Copy
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())
Copy
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));

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

Copy

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
        }
    }
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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"
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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\")"
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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))"
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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))"
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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))"
}'

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

Copy

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

Copy
cURL sample request with SQL-like body
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\")"
}`

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

Copy

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

Copy
cURL sample request with SQL-like body
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"
}'

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

Copy

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"
    }
}'

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

Copy

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"
    }
}'