Getting Started
This document provides instructions on how to start with the Expense REST and GraphQL APIs.
Prerequisites
Before you can call the APIs, you need to obtain an API subscription key and an instance-specific access token.
Obtaining API Subscription Key and Access Token
To obtain the API subscription key and access token, follow these steps:
- Navigate to Access Evo
- Create a new tab.
- Click on the
Add App
button. - Locate
ERP Application Register
section.ERP Application Register
has to be explicitly enabled for your organisation (if not already enabled). Note that only organisation administrator users can access theERP Application Register
.
- Use the following Evo applications available in the
ERP Application Register
:
-
ERP Subscription Manager: Use this Evo application to create API subscriptions, get API subscription keys, and regenerate API subscription keys. It is recommended to segregate API subscriptions per application/service/system that calls our APIs. Each subscription has two keys to allow key rotation. Choose
Expense
as the Product. -
ERP Token Generator: Use this Evo application to get your instance-specific access token. It is recommended to generate a new token for every application/service/system that calls our APIs. Tokens can have a maximum lifetime of 1 year, after which you need to generate a new token. Choose
Expense
as the Product and the Database Name you wish to connect to.warningTokens have a maximum lifetime of 365 days, depending on the settings at the time of generation. Once a token expires, it must be manually regenerated and updated on the client side. Failure to do so will result in API calls failing after the token has expired.
-
ERP API Usage: Use this Evo application to monitor the volume of API calls.
Making a Request
Once you have obtained your API subscription key and access token, you can make a request to the Expense REST API.
Here's an example of how to make a request:
curl -X GET -H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <Your-API-Subscription-Key>" \
-H "Authorization: Bearer <Your-Access-Token>" \
-H "X-Email: <Expense-User-Email>" \
https://api.erp.accessacloud.com/expense/api/v1/expenses/<Expense-Subscription-Id>/approvedexpenses
Replace <Your-Subscription-Key>
and <Your-Access-Token>
with your actual subscription key and access token.
Replace <Expense-User-Email>
with the Evo user email address. This user must have administrator level access to the Expense dataset you are querying.
Replace <Expense-Subscription-Id>
in the request URL with the Expense subscription Id corresponding to the dataset you are querying. This can be obtained by contacting Access.