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:

  1. POST /api/short-urls HTTP/1.1
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {
  6. "path": "d/TxKARsmGz/new-dashboard?orgId=1&from=1599389322894&to=1599410922894"
  7. }

JSON body schema:

  • path – The path to shorten, relative to the Grafana root_url.

Example response:

  1. HTTP/1.1 200
  2. Content-Type: application/json
  3. {
  4. "uid": AT76wBvGk,
  5. "url": http://localhost:3000/goto/AT76wBvGk?orgId=1
  6. }

Status codes:

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