A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://grafana.com/docs/grafana/latest/developers/http_api/ below:

HTTP API | Grafana documentation

Enterprise Open source

HTTP API reference

The Grafana backend exposes an HTTP API, which is the same API that’s used by the frontend to do everything from saving dashboards, creating users, and updating data sources.

HTTP API details are specified using OpenAPI v2.

There is also an OpenAPI v3 specification (generated by the v2 one).

Users can browser and try out both via the Swagger UI editor (served by the Grafana server) by navigating to /swagger-ui.

Authenticate API requests

You can authenticate HTTP API requests using basic authentication, a service account token, or a session cookie (acquired via regular login or OAuth).

Basic auth

If basic auth is enabled (it is enabled by default), then you can authenticate your HTTP request via standard basic auth. Basic auth will also authenticate LDAP users.

curl example:

curl http://admin:admin@localhost:3000/api/org
{"id":1,"name":"Main Org."}
Service account token

To create a service account token, click on Administration in the left-side menu, click Users and access, then Service Accounts. For more information on how to use service account tokens, refer to the Service Accounts documentation.

You use the token in all requests in the Authorization header, like this:

Example:

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_SERVICE_ACCOUNT_TOKEN>.

X-Grafana-Org-Id is an optional property that specifies the organization to which the action is applied. If it is not set, the created key belongs to the current context org. Use this header in all requests except those regarding admin.

Example Request:

GET /api/org/ HTTP/1.1
Accept: application/json
Content-Type: application/json
X-Grafana-Org-Id: 2
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
HTTP APIs Deprecated HTTP APIs Grafana Enterprise HTTP APIs

Grafana Enterprise includes all of the Grafana OSS APIs as well as the following APIs:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4