The report data API
The report data API returns the rows of an ABMS report as JSON, for Power BI or another tool. It has two calls: one to get a token, and one to fetch a report. Both use the same web address as your ABMS, followed by the path below. This page is for your IT department; how to set it up step by step is in Get report data into Power BI or another tool.
1. Get a token
Section titled “1. Get a token”| Item | Value |
|---|---|
| Method and path | POST /api/authenticate |
| Parameters | email: the API user’s e-mail address. password: its password. Send both in the request body. |
| Answer when it works | {"auth_token": "<token>"} |
| Answer when it fails | Status 401 with the text “invalid credentials”. |
| Valid for | 72 hours from when it was issued. |
The user must log in with a password. A user who logs in with Office 365 cannot get a token.
2. Send the token
Section titled “2. Send the token”Every call to the API needs this header:
Authorization: Bearer <token>
Without a token, or with an expired or wrong one, the answer is status 401 with {"error": "Not Authorized"}. Request a new token and try again.
3. Fetch a report
Section titled “3. Fetch a report”| Item | Value |
|---|---|
| Method and path | GET /api/v1/<customer ID>/documents/reports/<report ID> |
<customer ID> |
Your company’s customer ID in ABMS. The API user must have access to that company; otherwise the answer is status 401. |
<report ID> |
The ID of the report in ABMS. |
Which rights the API user needs to read the report: ask Antenor support.
Parameters
Section titled “Parameters”| Parameter | What it does | Required |
|---|---|---|
count |
The number of rows per page. | Yes in practice: without it, no rows are returned. |
page |
Which page of rows to return. | No |
language |
The language of the answer. | No |
For the allowed values and defaults of page and language, contact Antenor support. The API accepts further optional parameters (sort, reverse, search, archived, from, to). Contact Antenor support before relying on them.
Example: GET /api/v1/<customer ID>/documents/reports/<report ID>?count=500&page=1
Answer
Section titled “Answer”{ "documents": [ { "<column title>": <value>, "<column title>": <value>, ..., <link to the document> } ], "documents_count": <number>}documentshas one entry per document on the requested page. Each entry has one value per column in the report, named after the column title, and a link to the document.documents_countis the total number of documents in the report.- The columns are the report’s saved columns. The rows follow the report’s document types new, in progress and completed, its main filter, and any personal filters the API user has set on the report in ABMS. Archived documents are left out unless
archived=1is sent; see The report data API: parameters, rows and values in detail. When someone changes the report’s columns or filter on its Settings tab, the answer changes too; see The report Settings tab.