Prerequisite: You should have knowledge on Reports in kloudio and REST APIs.

What is a Custom API connection?

If you create Reports in Kloudio, you'll know that we use a Database or SaaS connection as the data source for your Reports. We specify database name, schema name, and table name to get data from your tables. If your data source is not in a database or supported SaaS application, this article will help you get data via a custom REST API.

For this example we'll be using a Fake API as our data source

Steps to create Custom API Report:

  1. Set up your Custom API connection

  2. Use your Custom API connection to create a Report. 

How to create a custom API connection?

  1. Login to the Kloudio dashboard

   2. Click on Connections

3. Click on New Connection 

4. Under Web Applications  section, click on Custom API 

5. Fill in the Connection Name (can be anything) and Base URL (Rest API's Base URL) 

6. You will see a page like this. If you want to set up authentication, you can use the Authentication section. It has options like Basic Auth or Bearer. You can also add headers. For this example we are going to keep it simple: 

6. Click Report Endpoint. This is used to get data from your REST API. There is another option called Template Endpoint that we will discuss in another article. 

7. Complete the following fields: Name (can be anything), URL (sub URL for the endpoint), Data Access Path (Which is a JSON Path, to access the data list from API Response), and Method (GET or POST).

8. In the end, you'll see the endpoint as shown below: 

How to create a custom API Report?

  1. Go to the Home Screen again

2. Click on Reports

3. Hover over new New Report, and click Report Builder 

4. You will see the Report Builder tool as shown below: 

 5. Click and Select the Connection name we created in the previous step (Create custom Connection). 

6. Click Search under section Select a Table/View/Endpoint 

7. You will see the Endpoint Name you added on the previous step (Create custom Connection). Click the Endpoint.

8. Here is the interesting part- now Kloudio will get all the columns from the response. Even though you have multiple levels in the JSON object, It will still provide all of the columns.

9. Select the Columns needed for the report. You can run a quick test by clicking the Test button. 

10. Finally, your API Data will populate the table. 

11. Save the report by giving it a name. 

12. Now you can use this report in Schedules to get the data in Google Sheets, Excel, or any other supported end-user tool. 

From Kloudio Team

Did this answer your question?