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",
|
|
|
|
"description": "The short code to resolve.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"security": [
|
2016-10-23 00:44:14 +03:00
|
|
|
{
|
2018-02-03 11:53:40 +03:00
|
|
|
"Bearer": []
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2018-08-13 17:17:43 +03:00
|
|
|
"description": "The URL info behind a short code.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
2018-08-13 17:17:43 +03:00
|
|
|
"$ref": "../definitions/ShortUrl.json"
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
}
|
2017-04-16 11:45:52 +03:00
|
|
|
},
|
|
|
|
"examples": {
|
|
|
|
"application/json": {
|
2018-08-13 17:17:43 +03:00
|
|
|
"shortCode": "12Kb3",
|
|
|
|
"shortUrl": "https://doma.in/12Kb3",
|
|
|
|
"longUrl": "https://shlink.io",
|
|
|
|
"dateCreated": "2016-05-01T20:34:16+02:00",
|
|
|
|
"visitsCount": 1029,
|
|
|
|
"tags": [
|
|
|
|
"shlink"
|
|
|
|
]
|
2017-04-16 11:45:52 +03:00
|
|
|
}
|
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.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No URL was found for provided short code.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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",
|
|
|
|
"description": "The short code to edit.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"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": [
|
2018-01-07 22:54:02 +03:00
|
|
|
{
|
2018-02-03 11:53:40 +03:00
|
|
|
"Bearer": []
|
2018-01-07 22:54:02 +03:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
|
|
|
"description": "The short code has been properly updated."
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Provided meta arguments are invalid.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 22:54:02 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No short URL was found for provided short code.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 22:54:02 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
2018-02-03 11:53:40 +03:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 22:54:02 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-09-15 14:07:52 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"ShortCodes"
|
|
|
|
],
|
|
|
|
"summary": "Delete short code",
|
|
|
|
"description": "Deletes the short URL for provided short code.",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"description": "The short code to edit.",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"Bearer": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
|
|
|
"description": "The short code has been properly deleted."
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "The visits threshold in shlink does not allow this short URL to be deleted.",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"examples": {
|
|
|
|
"application/json": {
|
|
|
|
"error": "INVALID_SHORTCODE_DELETION",
|
|
|
|
"message": "It is not possible to delete URL with short code \"abc123\" because it has reached more than \"15\" visits."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 00:44:14 +03:00
|
|
|
}
|
|
|
|
}
|