mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-25 16:31:16 -06:00
163 lines
5.2 KiB
JSON
163 lines
5.2 KiB
JSON
{
|
|
"get": {
|
|
"tags": [
|
|
"ShortCodes"
|
|
],
|
|
"summary": "Parse short code",
|
|
"description": "Get the long URL behind a short code.",
|
|
"parameters": [
|
|
{
|
|
"name": "shortCode",
|
|
"in": "path",
|
|
"description": "The short code to resolve.",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "The long URL behind a short code.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"longUrl": {
|
|
"type": "string",
|
|
"description": "The original long URL behind the short code."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"examples": {
|
|
"application/json": {
|
|
"longUrl": "https://shlink.io"
|
|
}
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Provided shortCode does not match the character set currently used by the app to generate short codes.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "No URL was found for provided short code.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Unexpected error.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
"put": {
|
|
"tags": [
|
|
"ShortCodes"
|
|
],
|
|
"summary": "Edit short code",
|
|
"description": "Update certain meta arguments from an existing short URL.",
|
|
"parameters": [
|
|
{
|
|
"name": "shortCode",
|
|
"in": "path",
|
|
"description": "The short code to edit.",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"description": "Request body.",
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"validSince": {
|
|
"description": "The date (in ISO-8601 format) from which this short code will be valid",
|
|
"type": "string"
|
|
},
|
|
"validUntil": {
|
|
"description": "The date (in ISO-8601 format) until which this short code will be valid",
|
|
"type": "string"
|
|
},
|
|
"maxVisits": {
|
|
"description": "The maximum number of allowed visits for this short code",
|
|
"type": "number"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"Bearer": []
|
|
}
|
|
],
|
|
"responses": {
|
|
"204": {
|
|
"description": "The short code has been properly updated."
|
|
},
|
|
"400": {
|
|
"description": "Provided meta arguments are invalid.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "No short URL was found for provided short code.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Unexpected error.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "../definitions/Error.json"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|