mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-24 09:50:17 -06:00
91 lines
3.3 KiB
JSON
91 lines
3.3 KiB
JSON
{
|
|
"get": {
|
|
"operationId": "shortUrlQrCode",
|
|
"tags": [
|
|
"URL Shortener"
|
|
],
|
|
"summary": "Short URL QR code",
|
|
"description": "Generates a QR code image pointing to a short URL.<br />Since this is not an API endpoint but an image one, when an invalid value is provided for any of the query params, they will fall to their default values instead of throwing an error.",
|
|
"parameters": [
|
|
{
|
|
"$ref": "../parameters/shortCode.json"
|
|
},
|
|
{
|
|
"name": "size",
|
|
"in": "query",
|
|
"description": "The size of the image to be returned.",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 50,
|
|
"maximum": 1000,
|
|
"default": 300
|
|
}
|
|
},
|
|
{
|
|
"name": "format",
|
|
"in": "query",
|
|
"description": "The format for the QR code image, being valid values png and svg. Not providing the param or providing any other value will fall back to png.",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["png", "svg"],
|
|
"default": "png"
|
|
}
|
|
},
|
|
{
|
|
"name": "margin",
|
|
"in": "query",
|
|
"description": "The margin around the QR code image.",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "errorCorrection",
|
|
"in": "query",
|
|
"description": "The error correction level to apply to the QR code: **[L]**ow, **[M]**edium, **[Q]**uartile or **[H]**igh. See [docs](https://www.qrcode.com/en/about/error_correction.html).",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["L", "M", "Q", "H"],
|
|
"default": "L"
|
|
}
|
|
},
|
|
{
|
|
"name": "roundBlockSize",
|
|
"in": "query",
|
|
"description": "Allows to disable block size rounding, which might reduce the readability of the QR code, but ensures no extra margin is added.",
|
|
"required": false,
|
|
"schema": {
|
|
"type": "string",
|
|
"enum": ["true", "false"],
|
|
"default": "false"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "QR code in PNG format",
|
|
"content": {
|
|
"image/png": {
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
},
|
|
"image/svg+xml": {
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "binary"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|