2022-05-26 10:06:25 -05:00
|
|
|
|
---
|
|
|
|
|
aliases:
|
2022-12-09 10:36:04 -06:00
|
|
|
|
- ../../http_api/short_url/
|
2023-02-06 11:14:36 -06:00
|
|
|
|
canonical: /docs/grafana/latest/developers/http_api/short_url/
|
2022-05-26 10:06:25 -05:00
|
|
|
|
description: Grafana Short URL HTTP API
|
|
|
|
|
keywords:
|
|
|
|
|
- grafana
|
|
|
|
|
- http
|
|
|
|
|
- documentation
|
|
|
|
|
- api
|
|
|
|
|
- shortUrl
|
|
|
|
|
title: 'Short URL HTTP API '
|
|
|
|
|
---
|
2020-10-14 05:48:48 -05:00
|
|
|
|
|
|
|
|
|
# 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:**
|
|
|
|
|
|
|
|
|
|
```http
|
|
|
|
|
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:
|
|
|
|
|
|
2022-06-02 11:57:22 -05:00
|
|
|
|
- **path** – The path to shorten, relative to the Grafana [root_url]({{< relref "../../setup-grafana/configure-grafana/#root_url" >}}).
|
2020-10-14 05:48:48 -05:00
|
|
|
|
|
|
|
|
|
**Example response:**
|
|
|
|
|
|
|
|
|
|
```http
|
|
|
|
|
HTTP/1.1 200
|
|
|
|
|
Content-Type: application/json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"uid": AT76wBvGk,
|
2021-06-01 07:19:10 -05:00
|
|
|
|
"url": http://localhost:3000/goto/AT76wBvGk?orgId=1
|
2020-10-14 05:48:48 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Status codes:
|
|
|
|
|
|
|
|
|
|
- **200** – Created
|
|
|
|
|
- **400** – Errors (invalid JSON, missing or invalid fields)
|