How to import REST API Data

I woulld like to receive data from one of my REST API url and display into the dashboard. Can someone walkthrough the process of configuring the following API?

URL
https://api.oip.tm.com.my/app/iot/1.0/api/plugins/telemetry/DEVICE/365ad9b0-16b7-11e8-ace1-e91f8f4d7baf/values/timeseries?keys=humidity,temp

METHOD
get

Headers
X-Authorization: Token
Authorization:Token

1 Like

Hi,

You probable want to use Simple JSON Datasource plugin. To do that you need to implement a rest api that conforms to simplejson request/response formats and that in turn calls out to your external api.

Please refer to my comment here Grafana simplejson dashboard

Marcus

1 Like

Hi,

You can use grafana JSON data source as @mefraimsson explained for specific use cases.

Otherwise for simple use cases, you can use Infinity datasource. This is generic implementation for making API requests from Grafana.

NB: I am the author of the plugin.

Thanks,
Sriram

4 Likes

Hi @yesoreyeram,

Inifinity Datasource looks great. I have one doubt though, does it have support for Authorization headers? My usecase is to display JSON data from an API protected by Bearer token.

Thanks,
Omkar

1 Like

Hi, im new to grafana, and try out the sriram plugin but an error comes up

1 Like

Currently simple username/password or any header based tokens supported.

This is a popular topic with some old answers whose context has changed over time. So here’s a good up-to-date answer:

In Grafana you should use the Infinity data source plugin to do pretty much any work with REST APIs. It has many options for authentication and various other settings.

The Grafana docs gives a worked example of how you can do this end-to-end; on this particular documentation page, it’s working with an AWS API, but the principles are the same. If you’re looking to work with REST API data, check this page out, and simply substitute the AWS API endpoints for your own; this provides a walk-through of configuring each bit.