grafana/docs/sources/developers/http_api/short_url.md
Jack Baldry 4037e5e325
Add canonical URL to all HTTP API docs (#62957)
Facilitates mounting these docs in the Grafana Cloud documentation set
without affecting SEO.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-02-06 17:14:36 +00:00

1.2 KiB
Raw Blame History

aliases canonical description keywords title
../../http_api/short_url/
/docs/grafana/latest/developers/http_api/short_url/ Grafana Short URL HTTP API
grafana
http
documentation
api
shortUrl
Short URL HTTP API

Short URL API

Use this API to create shortened URLs. A short URL represents a longer URL containing complex query parameters in a smaller and simpler format.

Create short URL

POST /api/short-urls

Creates a short URL.

Example request:

POST /api/short-urls HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

{
  "path": "d/TxKARsmGz/new-dashboard?orgId=1&from=1599389322894&to=1599410922894"
}

JSON body schema:

  • path The path to shorten, relative to the Grafana [root_url]({{< relref "../../setup-grafana/configure-grafana/#root_url" >}}).

Example response:

HTTP/1.1 200
Content-Type: application/json

{
  "uid": AT76wBvGk,
  "url": http://localhost:3000/goto/AT76wBvGk?orgId=1
}

Status codes:

  • 200 Created
  • 400 Errors (invalid JSON, missing or invalid fields)