# NR Grafana API keys

**URL:** <https://discourse.nodered.org/t/nr-grafana-api-keys/33045>\
**Category:** General\
**Created:** [18 September 2020 13:31 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045 "2020-09-18T13:31:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [18 September 2020 13:31 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/1 "2020-09-18T13:31:37Z")

</div>

Hi. I Was wondering can we use Grafana API keys, to secure the InfluxDB using NR?  
Is it possible to do something like this, but with NR?

> **[Raspberry Pi: Protegiendo nuestro Telegraf, InfluxDB, y Grafana que...](https://www.jorgedelacruz.es/2020/06/03/raspberry-pi-protegiendo-nuestro-telegraf-influxdb-y-grafana-que-ejecutamos-en-raspberry-pi-8gb/)**
>
> Raspberry Pi: Protegiendo nuestro Telegraf, InfluxDB, y Grafana que ejecutamos en Raspberry Pi 8GB

> **[How To Create a Grafana Dashboard? (UI + API methods) – devconnected](https://devconnected.com/how-to-create-a-grafana-dashboard-ui-api-methods/)**
>
> A complete guide on how to create a Grafana dashboard in 2019 using the built-in UI or the API with tokens. (v6.0+ compatible)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 September 2020 17:03 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/2 "2020-09-18T17:03:34Z")

</div>

Well, you can use the key to access the Grafana API - easy enough to translate the curl command in the 2nd link to use with an http-request node.

But not sure what you mean be "secure the InfluxDB using NR". How can you use a Grafana API bearer token to secure InfluxDB?

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [19 September 2020 11:59 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/3 "2020-09-19T11:59:30Z")

</div>

Something like extra Authentication, but with API key from Grafana. Is it possible?

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [19 September 2020 12:02 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/4 "2020-09-19T12:02:37Z")

</div>

> **[InfluxDB](http://www.matjazcerkvenik.si/developer/influxdb.php)**

```auto
HTTP API

InfluxDB offers HTTP API to communicate with external systems and clients. HTTP clients are very easy to implement in any programming language. Response is returned in JSON format.

HTTP API provides 3 endpoints:
/ping - check database status
/query - query data
/write - write data to database

```

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [19 September 2020 13:23 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/5 "2020-09-19T13:23:04Z")

</div>

> **[Authentication HTTP API](https://grafana.com/docs/grafana/latest/http_api/auth/)**
>
> Grafana Authentication HTTP API

Something like this in NR?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 September 2020 18:42 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/6 "2020-09-19T18:42:45Z")

</div>

Short answer: No.

Unfortunately, Discourse prevents me from having a 3 character reply. 😈

InfluxDB needs its own authentication and has that capability.

Of course, both Grafana and InfluxDB API's are web based. That means that it is possible to build a proxy to handle authentication, authorisation and even traffic. Beyond the subject matter of this forum though I'm afraid. I suggest using the InfluxDB forum for further information & support.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [20 September 2020 09:49 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/7 "2020-09-20T09:49:21Z")

</div>

Can i use this:

> **[Authentication HTTP API](https://grafana.com/docs/grafana/latest/http_api/auth/)**
>
> Grafana Authentication HTTP API

```auto
GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

The Authorization header value should be Bearer <your api key>.

```

OR this **[https://medium.com/@teebr/iot-with-an-esp32-influxdb-and-grafana-54abc9575fb2](https://medium.com/@teebr/iot-with-an-esp32-influxdb-and-grafana-54abc9575fb2)**

In that way:

 ![Authorisation](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffb4e8bc3f9b3775e97af83f39408ed1aba34683.jpeg)

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [21 September 2020 18:00 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/8 "2020-09-21T18:00:07Z")

</div>

I've try this, but get this error.  
Any help, please?

 ![2020-09-21-205138_800x480_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/6445a5bea50a388b3193ba338b97356a52cd874a.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 November 2020 18:00 UTC](https://discourse.nodered.org/t/nr-grafana-api-keys/33045/9 "2020-11-20T18:00:08Z")

</div>

Closed on 20 November 2020 18:00 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
