REST API
Boltic supports Integration with REST API. It fetches data from your REST API data source and allows you to create a Bolt that contains a sequence of actions such as Integration, Transformation, and Destination. In addition to this, you can schedule a Bolt at a fixed interval or date and time.
Prerequisites
A basic understanding of JSON path and JSON expression
To access any private API, Boltic either needs its API key or username and password.
Setup Guide to Integrate REST API With Boltic
This guide will give you a brief idea of the steps you need to follow to integrate the REST API into Boltic
Step 1: Add Integration
Visit the Add Integration page to select REST API as an Integration
Step 2: Configuring REST API as an Integration
Give a meaningful name to the Integration
To call the API, enter the valid endpoint URL and then select a method
Available HTTP Methods
GET Retrieve data from a server
POST Sends data to the server for processing
PUT updates the data that is stored in the server
Data root can be used to define the array node location of the data that you want to get. To select and extract the data from the API, it is requirable to enter its root path.
Let's say, we have an API https://pokw7le0rk.execute-api.ap-south-1.amazonaws.com/stage1/mock/pagination1?page
{
"data": [
{
"buzzword": "hierarchy",
"car_model": "7 Series",
"email": "jpauley0@nps.gov",
"first_name": "Jessie",
"gender": "Male",
"id": 1,
"ip_address": "232.173.145.70",
"is_true": false,
"last_name": "Pauley",
"record_cursor": "928b66cf-989e-4949-a4ff-81f48df836da"
},
{
"buzzword": "customer loyalty",
"car_model": "Caravan",
"email": "vcrace1@jiathis.com",
"first_name": "Vanya",
"gender": "Male",
"id": 2,
"ip_address": "169.105.8.128",
"is_true": false,
"last_name": "Crace",
"record_cursor": "1b2b670a-d0fd-4285-be8e-3a471eaffae2"
}
]
Data root path of this API would be data .
Sometimes there might be a case where you have nested JSON data. To call it's path, you need to use a simple dot notation expression. In the below-mentioned example, we have data that has a parent object-store and a child object-book. To query for the details of each book in the document we will enter store.book
{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{ "category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
Dynamic Fields
Parameters Section
REST parameters specify the variable parts of your resources. They help you decide what kind of action you want to take with the resource. You will obtain all of the data if you don't specify any parameters. To filter out the data, specify the parameters. For example, if you have a food sales API, and want to fetch the data as per the region, then pass Key- Region and Value- West.
From here, you can access all of the query parameters contained in the API and create and update existing parameters
Note
Please provide parameters in Key-Value format as shown in the params section
- Key: The name of the parameter.
- Value: The value of the parameter.
Headers
In headers you can add extra source of information for each API call you make. It mainly contains authentication details such as userID, cookies. Click on the Headers section and fill in the key and value.
Body
For POST
and PUT
requests, you can include a request body under the Body section to send the payload along with your API request.
Note
Currently, Boltic support only JSON format for entering the values in the "Body"
Cookies
Boltic also supports APIs that use cookies for authentication. Cookies should be provided in the key-value format.
Scheduled Refresh
Boltic automatically refreshes your data. When adding a Rest API as Integration to Boltic, you might want to see the latest updates and deletes. Click Scheduled Refresh to keep imported REST API data up-to-date.
- Go to the Scheduled Refresh section, click the Pencil Edit icon
Depending on your requirement, you can create Hourly, Daily, Monthly and Daily Schedules.
Save Schedule
Authorization
When working with REST APIs you must remember to consider security from the start. By default it is inactive. You can enable authorization by clicking on the slider, select an appropriate authorization Type and then provide the requested credentials.
Boltic supports the following API authorization methods -
Type | Dropdown to be Selected | Info to be Added |
---|---|---|
Basic Authentication | Basic Auth | Username and Password |
API Key | API key | Provide the Key and Value. And select the "Location" |
Note
In API Key Authentication, on selecting Location, you can choose from either of the following two options
- Headers
- Query Param
Pagination
You can paginate the JSON response that is called from the REST API. The data is kept in the same sequence from page to page.
Read REST API Pagination doc for more information on how to paginate JSON response.
Add Info
Its metadata, which includes a description, can be used for surfacing information to end-users and as tags for monitoring. Click on the More Options button to enter the metadata.
Congratulations
You have now successfully integrated your REST API to Boltic!
Any Question? 🤓
We are always an email away to help you resolve your queries. If you need any help, write to us at - 📧 support@boltic.io