What's in this article:
Why use Rest API as a Datasource?
Avenue's REST API provides users with the ability to connect to and gather data from external endpoints outside of their organization. This can include third-party services that offer APIs, which allows for a wide range of possibilities when it comes to monitoring external events.
The REST API data source allows you to specify an API endpoint and headers that should be sent alongside a GET
/ POST
request to that endpoint.
Once a REST API endpoint has been set up, you can set the POST
body or JSON-encoded URL parameters in the individual queries against that endpoint.
The response is parsed as a JSON array, or if there is a single JSON object, the data source will return one row with that object's key-value pairs.
Setting up the Rest API Datasource
Here are the steps to get your Rest API Datasource setup:
1. Navigate to Data Sources
2. Select + Add New Connection
3. Select Rest API as your Datasource Type and enter a display name
4. Add the applicable headers as Key:Value
pairs
*These could include things like API Keys and App Keys.
5. Make sure you test your connection!
Test connection will send a request with an empty body to the endpoint to make sure that it is accessible and returns a 2XX
response.
6. Once you have tested and confirmed the connection select Connect Database
โ๏ธ If you need any help or have any questions please contact support by email, or at any time within the app, scroll down to the Get Help button on the left navigation bar.