How to add Authorization: Bearer token with JSON datasource plugin

I am using the JSON datasource plugin and am trying to setup a new URL that uses an authorization: bearer token. How do I enter it? I have tried this (shown below) and also tried with the OAuth toggle selected (instead of With Credentials) and got the same result.

Here is the documentation from the API which I am trying to use: QuickBooks Time API Reference

I tested my URL and bearer token in Node-RED using HTTP GET request and was able to get the data fine, so I know my URL and token work. It’s only in this plugin that I cannot figure out how to insert my token as a Custom HTTP Header

1 Like

Move Bearer to Value

Header = Authorization
Value = Bearer SomeAuthKey

5 Likes

How do you do token refresh with this plugin?

From my experience, most API access tokens are relatively short lived, and there’s an OAuth2 flow to obtain an access token via a client credentials grant.

Has anyone found a solution for this yet? I am facing the same issue, and I have written a script to update the token via the Grafana datasources API. However, it is not working as expected.

Anyone with a solution? I need to call a login API first to grant the token and then use it in the main API call

I would recommend using this plugin

https://grafana.github.io/grafana-infinity-datasource/docs/authentication