Get Started with Data Query API

Everything you need to know to get started with the Data Query API.

Get a Visier Account

To use the APIs, you must have a Visier account with a profile that has the API capability. If you don't have an account, contact your administrator. They will create an account for you with permissions that allow you to view data.

In addition to an API profile, your API user must have permission to access the data that you request through the Data Query API. For more information, see Data Security for a Permission.

Generate your API key and security token

To make an API request, you will need an API key and a security token. For more information about how to get an API key and request a security token, see API Authentication.

Note: If using Postman to send requests, you can request a security token directly in the tool, see Use Postman to Call Visier APIs.

Choose your tool

To begin working with the Data Query API you will need to choose a tool to make your first request. This can be Postman or whichever method you usually use to make HTTP requests. For more information about using Postman for your first request, see Use Postman to Call Visier APIs.

Make your first request

To test that you have everything set up correctly, we’ll make a request to retrieve data from the Headcount metric in Visier using the /v1/data/query/aggregate endpoint. For a complete list of available endpoints, see "Data Query" in API Reference.

The following sample request is used to retrieve 1 month of Headcount data up to January 1, 2021. It does not use any group bys or filters. Replace {vanity_name} with your tenant name. The API key is expected as a header, while the security token is expected as a cookie.

Copy
cURL sample request: Retrieve 1 month of Headcount data up to January 1, 2021
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": {
            "fromDateTime": "2021-01-01"
        }
    }
}'

If everything was set up correctly and the request was successful, you should see a similar response:

Copy
Sample response
{
    "cells": [
        {
            "value": "4071",
            "support": "4071",
            "coordinates": [
                0,
                0
            ]
        }
    ],
    "axes": [
        {
            "dimension": {
                "name": "Measures",
                "qualifyingPath": ""
            },
            "positions": [
                {
                    "path": [
                        "MeasureName"
                    ]
                }
            ]
        },
        {
            "dimension": {
                "name": "DateInRange",
                "qualifyingPath": ""
            },
            "positions": [
                {
                    "path": [
                        "2021-01-01T00:00:00.000Z - [0]"
                    ]
                }
            ]
        }
    ]
}

Note: Each data model is unique to each Visier tenant, depending on purchased applications and any custom objects. The objects in the response are retrieved from the tenant specified by the tenant name in the request.

Next steps

Now that you've successfully authenticated and completed your first API request, you're ready to retrieve more data with the Data Query API.

To learn more: