2016-10-23 00:44:14 +03:00
|
|
|
{
|
|
|
|
"get": {
|
2016-10-23 01:07:31 +03:00
|
|
|
"tags": [
|
|
|
|
"ShortCodes"
|
|
|
|
],
|
|
|
|
"summary": "Parse short code",
|
2016-10-23 00:44:14 +03:00
|
|
|
"description": "Get the long URL behind a short code.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"type": "string",
|
|
|
|
"description": "The short code to resolve.",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "../parameters/Authorization.json"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "The long URL behind a short code.",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"longUrl": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The original long URL behind the short code."
|
|
|
|
}
|
|
|
|
}
|
2017-04-16 11:45:52 +03:00
|
|
|
},
|
|
|
|
"examples": {
|
|
|
|
"application/json": {
|
|
|
|
"longUrl": "https://shlink.io"
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Provided shortCode does not match the character set currently used by the app to generate short codes.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No URL was found for provided short code.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 22:54:02 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
"put": {
|
|
|
|
"tags": [
|
|
|
|
"ShortCodes"
|
|
|
|
],
|
|
|
|
"summary": "Edit short code",
|
|
|
|
"description": "Update certain meta arguments from an existing short URL.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"type": "string",
|
|
|
|
"description": "The short code to edit.",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "validSince",
|
|
|
|
"in": "formData",
|
|
|
|
"description": "The date (in ISO-8601 format) from which this short code will be valid",
|
|
|
|
"required": false,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "validUntil",
|
|
|
|
"in": "formData",
|
|
|
|
"description": "The date (in ISO-8601 format) until which this short code will be valid",
|
|
|
|
"required": false,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "maxVisits",
|
|
|
|
"in": "formData",
|
|
|
|
"description": "The maximum number of allowed visits for this short code",
|
|
|
|
"required": false,
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "../parameters/Authorization.json"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
|
|
|
"description": "The short code has been properly updated."
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Provided meta arguments are invalid.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No short URL was found for provided short code.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
}
|