Atria API

Atria API

Atria API

Purpose

The Atria API is a new Rest-based integration point that over time will replace the functionality of the old API, (known as the CortexAPI).  If you have developed against The CortexAPI, don’t worry, it’s still working and supported. 

Requirements:
  1. Atria 12.11 or higher
  2. A valid Atria external API Token

Benefits

The new API will be easier for developers to understand and consume and will be built using standard conventions.
Our initial release is focused on Billing, the API can be used to extract your billing information directly into spreadsheets, PowerBI, or third-party systems.

Using the API

Authentication

Authentication to the API uses a JWT token, the application communicating with Atria, presents the token, this is then validated against a user in Atria, if valid access is permitted and the API call is executed.
Tokens are created within Atria and are attached to a user account.
If the user account in Atria is disabled, then API access via the token attached to that user will also be disabled.   Note that the user account must be disabled via Atria in order to disable API access, disabling the associated AD user account will not immediately block access.
At the time of writing, AD Account expiry will not disable API access.

Authorization

In order for a user to have an API token, they must be granted the “Service Provider Developer” permission.  Once they have this permission, the change password page allows the tokens to be created and deleted.
In order to grant "Service Provider Developer" permission to a user follow the below steps:

  1. Click on Users -> select a user -> Edit User -> Account Settings -> Advanced Options -> Enable "Service Provider Developer" check-box

Creating a Token

Login or impersonate a user that has access, click on the “Password” link on the left-hand menu.  Half way down the page you should see a “Generate API Access Token” – click on the “Generate” link to create a new token.

Once you leave this page, you will not be able to view the token again, it is encrypted and stored in the database, if you forget the token you will need to create another one and reconfigure your applications.
 Store the token securely and protect it in the same way as credentials.

Using the Token

The token should be provided as an Authorization header for every call made to the API.  If the token is not present the API call will fail.

Header name
Value
Authorization
Bearer {token} 

Billing API Calls

Billing Parameters

/api/Billing/parameters
This GET command will return 
- All of the billing periods that are available within your Atria system
- All of the Customers contained within the system and their customerIDs

Curl Syntax

  1. curl -X GET "https://{API HOSTNAME}/api/Billing/parameters" -H "accept: text/plain" -H "Authorization: bearer a8cab2d1ae00df4a7edd514af7828d7df672054c89feb753305f17c403127769"

Successful Response Format

  1. {
  2.   "data": {
  3.     "endDates": [
  4.       {
  5.         "label": "2019-10-31"
  6.       },
  7.       {
  8.         "label": "2019-11-30"
  9.       },
  10.       {
  11.         "label": "2019-12-31"
  12.       },
  13.       {
  14.         "label": "2020-01-31"
  15.       },
  16.       {
  17.         "label": "2020-02-29"
  18.       },
  19.     ],
  20.     "customers": [
  21.       {
  22.         "id": 30,
  23.         "name": "Aanimals Inc"
  24.       },
  25.       {
  26.         "id": 102,
  27.         "name": "Abacus Computing Group"
  28.       },
  29.       {
  30.         "id": 57,
  31.         "name": "Able Metals Limited"
  32.       },
  33.       {
  34.         "id": 5,
  35.         "name": "Abracard Limited"
  36.       }
  37.       ]

Curl Syntax (Powershell)

  1. curl -Uri "https://{API HOSTNAME}/api/Billing/parameters" -Method Get -Headers @{
  2.     accept = "text/plain"
  3.     authorization = "bearer a8cab2d1ae00df4a7edd514af7828d7df672054c89feb753305f17c403127769"
  4. }



    • Related Articles

    • Atria API Policy

      Purpose To provide direction and guidance to Atria customers and third parties integrating with Atria API’s. Atria API's API Name Type Purpose Cortex API XML based over HTTPS https://{hostname}/cortexapi Used by AD Sync, Customer, User, Service ...
    • How to connect Power BI to Atria API

      Overview In this article, we are going to show you how to connect to Atria API via Power BI.  Power BI will be able to retrieve data to create visuals and reports based on your requirements. The following article will illustrate a step by step guide ...
    • Atria API User Guide (CortexAPI)

      Overview The application programming interface (API) is a powerful interface that allows you to interact directly with Atria without using the ATRIA Web User Interface (UI).  The API grants a user, with some development knowledge, the ability to ...
    • Atria v12.11+ System Requirements

      Overview  The following article provides the prerequisites necessary for the deployment of Atria v12.11+ into your environment.  System Requirements   Environment  Core servers for the platform should be domain joined. Before you can deploy Atria ...
    • How to connect to Atria External Billing API via Excel

      Atria External API via Excel This document illustrates how to use Atria's external API platform to retrieve billing invoice data via an Excel document. Applies to: Atria 12.11 or later Create Token Use the following KB as a step by step to receive ...