Avero API: Getting Started
When you first receive your Avero API credentials you'll need to import our spec and set up the tool you are going to use. Below is a guide to setting up Postman, a common tool to access, authenticate, and query APIs.
In this article:
See also: Partner Resources, API Partners: FAQs
Prerequisite
To proceed to querying the API, you'll need to use a tool, Postman is a common example, to access, authenticate, and engage with the Avero API. You can install a tool or use a web-based tool,
Once your tool is in place, you'll import the spec for our API to preload the necessary details for the Avero API (like our endpoints and some parameters.
Setup & Authorization
Import the Yaml Spec for the Avero API
Scroll to the bottom of this article and download the attachment there: Avero-API-Spec.yaml.
Open Postman and select a workspace. Click Import to open a pop-up window.
Drag the downloaded yaml spec to import.
Click Import to finish.
Setup authorization for your API
Now that you have an API in Postman, you'll need to configure it to authenticate with the Avero API. Click on the “Avero Public API” sub-folder and do the following:
- Set the
Grant Type
toClient Credentials
- Set
Client ID
to{{client_id}}
- Set
Client Secret
to{{client_secret}}
- Save the tab! (ctrl+s, cmd+s, or click the
Save
button in the upper right)
The {{client_id}}
and {{client_secret}}
fields will be a dull red. This is because they are templated variables and you haven’t told Postman what values these should have. We’ll do that in the environment setup later.
Configure your environment(s)
Environments are where we’ll configure the different values for our templated variables in our Postman calls. You’ll want one environment for each customer or partner (i.e. set of credentials) you’re using to talk to the API.
In the Environments
side panel, click Create Environment
or use the New
menu and select Environment
.
Name your new environment. It should reflect the customer or partner this environment is for. Add a variable for client_id
and one for client_secret
and then populate the initial and current values with the values provided during credentials setup.
- Your
client_id
was provided to you as the KEY - Your
client_secret
was provided to you as the SECRET
Don’t forget to save your changes!
Once you’ve saved your environment it should now appear in the environment dropdown, where we currently see No Environment
.
Making an authenticated request
Now that we have our environment set up, we can make a fully authenticated request.
Select your environment from the environment dropdown (the one you just created).
Back on the Avero Public API
page where we set up our authorization earlier, you’ll now see that the {{client_id}}
and {{client_secret}}
values are a brighter orange color, meaning Postman is pulling the values from the set Environment.
Click Get New Access Token
. You’ll see a progress dialog that will automatically close and end up on the Manage Access Tokens
page.
Click Use Token
and you’ll be brought back to the Authorization
page and the Access Token
field will be populated.
We can finally make a real request! Go back to the APIs
side panel, expand the Avero Public API
and open the top-level GET
request. Uncheck the checkbox next to Cursor
and click Send
In the results pane, you should now see data from the API response. Success!