Implement Authentication Header in Simple Json

Hello

I try to understand how the SimpleJson plugin works.
I need to pass an authentication header in my request, something like: "“Authorization”: “GenieKey ”. My request is going to the Opsgenie Alert API: Alert API and I want to use that json as datasource. This is the url: https://api.opsgenie.com/v2/alerts But so far I keep getting errors about my headers. This is the error I get (it seems that my request is working properly but that it is blocked by a missing CROS header):


Is there any way to implement the nessecary headers properly? Or can I disable the CORS policy in SimpleJson?

Please have a look at this which should explain how the simple json plugin works: Grafana simplejson dashboard

Seems to me you’re trying to use https://api.opsgenie.com/v2/alerts as the url when configuring simple json datasource. That don’t work. To use the simple json datasource you probably need to have a service in between which receives request from simple json datasource, do a request to https://api.opsgenie.com/v2/alerts and then translate and return a response that simple json datasource understands. The service in between is where you’ll put the logic for authenticating with opsgenie, like custom http headers.

@jarne Hi, did you find a way to solve the issue? Even I am trying to do the same thing…

@mefraimsson Could you please elaborate more on the part " service in between which receives request from simple json datasource, do a request to API and then translate and return a response that simple json datasource understands. The service in between is where you’ll put the logic for authenticating with opsgenie, like custom http headers."
I am new to grafana, so your help would be much appreciated.

Thanks in advance!
Sourabh