In this article:
API token | Formats | Data sets | Get schema | Row count | Column info | Column values | Get data | Get report data | Power query | Import data | Clear data | Clear cache

Integration

You can retrieve data from -and import data into- data sets through our REST API. You can send data directly from another system or database into your data sets without having to go through the web pages. You can also retrieve data from your data sets to send it straight into another system or even directly into an Excel workbook.

This page describes inbound API integration. For outbound API connections, please refer to import connectors.

XLReporting provides the following API methods:

All requests need to be made using GET or POST methods over HTTPS, and responses and results will be returned as JSON objects. All responses include a success property which indicates (true/false) whether the request was succesful.

Please note that this option is only accessible if your user role has Access API permission, and only for data sets that have Access API permission.

API token

You need to provide a valid API access token with all requests. Tokens are issued by users through Manage - Profile - Actions, and are personal to every user. Users can revoke or renew tokens at any time. At every API request, XLReporting verifies the token against the user who issued it, and that user must still exist, be active, have the right token, and have the relevant permissions for the API request to be processed.

You can pass the token either as a URL parameter (token=xxx) or as a custom HTTP Header (x-access-token: xxx). For security reasons, we recommend you pass the token as a custom HTTP header whenever possible, as this will keep the token more secure in transit.

Notes:

Formats

All data is transmitted and returned as JSON objects. Dates need to be passed as per ISO 8601 (e.g. yyyy-mm-dd), numbers need to be passed with decimal points without thousands separators (e.g. 1600.45).

Data sets

It is important to understand that data sets are configurable objects, and unique for every tenant. They can be created, changed, and deleted at any time. The columns within a data set are also configurable. So data sets and columns are likely to be different for every tenant.

The names of data sets and columns are simply visual labels in the web application, which can be renamed on the fly. In API requests you can only refer to the internal ID's of objects. So when you make API requests to a data set, you need to know its metadata: its internal ID, and its collection of column ID's.

You can view that metadata by clicking on Actions - Get API access within a given data set:

screenshot define datasets api

✭ Tips:

Select the API method in the dropdown, and you will see the appropriate URL for your data set, for example: https://eu.xlreporting.com/table/t1?token=xxxxx (you should replace xxxxx with your real API token). The left panel will show a small sample of the data in your data set, and the right panel will show the metadata of its columns, for example:

[{
    "id": "f1",
    "name": "Account code",
    "type": "key"
},
{
    "id": "f2",
    "name": "Account name",
    "type": "text"
},
{
    "id": "f3",
    "name": "Account type",
    "type": "text"
},
{
    "id": "f4",
    "name": "Account category",
    "type": "text"
},
{
    "id": "f5",
    "name": "Account subcategory",
    "type": "text"
}]

In all API requests, you need to work with these column ID's, never with the column names.

Get schema data

Returns all active data sets.

Method:
GET https://eu.xlreporting.com/schema?token=xxxxx

Result:
"success": true,
"data": [{
    "id": "t1",
    "value": "Accounts"
},
{
    "id": "t2",
    "value": "Companies"
},
{
    "id": "t3",
    "value": "Balances"
}]

Get row count

Returns the number of data rows in the data set. You need to pass the data set ID in your request.

Method:
GET https://eu.xlreporting.com/table/stats/t1?token=xxxxx

Result:
"success": true,
"data": 54

Get column info

Returns the defined columns of the data set, and the properties of all columns. You need to pass the data set ID in your request.

Method:
GET https://eu.xlreporting.com/table/fields/t1?token=xxxxx

Result:
"success": true,
"data": [{
    "id": "f1",
    "name": "Account code",
    "type": "key"
},
{
    "id": "f2",
    "name": "Account name",
    "type": "text"
},
{
    "id": "f3",
    "name": "Account type",
    "type": "text"
},
{
    "id": "f4",
    "name": "Account category",
    "type": "text"
},
{
    "id": "f5",
    "name": "Account subcategory",
    "type": "text"
}]

Get column values

Returns the list of values from data in a given column. You need to pass the data set ID and the column ID in the request.

Optionally, you can provide additonal query parameters:

Method:
GET https://eu.xlreporting.com/table/values/t1/f1?token=xxxxx
GET https://eu.xlreporting.com/table/values/t1/f1?filter=f3:BS&token=xxxxx

Result:
"success": true,
"data": [{
    "10000",
    "10010",
    "10020",
    "10100",
    "10110"
}]

Get all data

Returns the data content of the data set. You need to pass the data set ID in your request.

Optionally, you can provide additonal query parameters:

Method:
GET https://eu.xlreporting.com/table/t1?token=xxxxx
GET https://eu.xlreporting.com/table/t1?filter=f3:BS&token=xxxxx

Result:
"success": true,
"data": [{
    "f1": "10000",
    "f2": "Buildings",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
},
{
    "f1": "10010",
    "f2": "Furniture & Fittings",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
},
{
    "f1": "10020",
    "f2": "IT & Equipment",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
}]

Get report data

Returns the data content of a report. You need to pass the full report query string into your request, including lookups, filters and showed fields, which you can derive by using the web application.

As part of the query string, you can provide additonal query parameters:

Method:
https://eu.xlreporting.com/api/report/r1/t1?lookup=t1:f2:t2&show=f1:t1:f2,f2:t1:f3,f3:t2:f2:SUM&filter=t1:f4:2023-12&token=xxxxx

Result:
"success": true,
"data": [{
    "f1": "10000",
    "f2": "Revenue",
    "f3": 20000
}]

Power query

In addition to calling the API to retrieve data, you can also access data sets and reports directly from Excel or PowerBI using Power queries. This enables you to design your own reports in Excel or PowerBI using realtime data from XLReporting. The data will be automatically refreshed at any time without you having to login to XLReporting.

XLReporting creates a small file for you specific to each data set, which you can open in Excel via Data - Get external data.

You can choose to store your API token and selected values in the file, or leave them as runtime parameters.

screenshot export excel query

Import data

To import data into the data set, you need to pass the data set ID in the request, as well as a JSON-encoded request body with the following properties:

For more detail on the replace option, please refer to Define imports.

Method:
POST https://eu.xlreporting.com/table/import/t1?token=xxxxx

Request body:
"type": "replace",
"replace": {"f3": "BS"},
"data": [{
    "f1": "10000",
    "f2": "Buildings",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
},
{
    "f1": "10010",
    "f2": "Furniture & Fittings",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
},
{
    "f1": "10020",
    "f2": "IT & Equipment",
    "f3": "BS",
    "f4": "10. Fixed Assets",
    "f5": "100. Fixed Assets (cost value)"
}]

Result:
"success": true,
"data": {}

Clear data rows

To clear data from this data set, you need to pass the data set ID in the request, as well as a JSON-encoded request body with the following properties:

Method:
POST https://eu.xlreporting.com/table/clear/t1?token=xxxxx

Request body:
"filter": "f1:2019-01"

Result:
"success": true,
"data": {}

Clear cached data

To clear all report caches that refer to this data set, you need to pass the data set ID in the request. No request body is needed. Please note that report caches are automatically purged whenever data is imported into a data set, so you don't need to do this manually.

Method:
POST https://eu.xlreporting.com/table/cache/t1?token=xxxxx

Result:
"success": true,
"data": {}

Need any help?

We have several tools, connectors, and examples available for integration, and we provide free consulting, so please contact us anytime.

Recommended reading:
Back to top | Data sets

We value your privacy

We use cookies to enhance your browsing experience and analyze our traffic.
By accepting, you consent to our use of cookies.

Accept Reject Cookie Policy