2016-10-22 16:44:14 -05:00
|
|
|
{
|
|
|
|
"get": {
|
2018-09-20 13:52:27 -05:00
|
|
|
"operationId": "getShortUrl",
|
2016-10-22 17:07:31 -05:00
|
|
|
"tags": [
|
2018-09-20 13:52:27 -05:00
|
|
|
"Short URLs"
|
2016-10-22 17:07:31 -05:00
|
|
|
],
|
|
|
|
"summary": "Parse short code",
|
2019-12-31 09:05:02 -06:00
|
|
|
"description": "Get the long URL behind a short URL's short code.",
|
2016-10-22 16:44:14 -05:00
|
|
|
"parameters": [
|
2019-11-29 12:09:03 -06:00
|
|
|
{
|
|
|
|
"$ref": "../parameters/version.json"
|
|
|
|
},
|
2016-10-22 16:44:14 -05:00
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"description": "The short code to resolve.",
|
2018-02-03 02:53:40 -06:00
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
2019-10-04 14:17:02 -05:00
|
|
|
},
|
|
|
|
{
|
2020-02-02 02:15:43 -06:00
|
|
|
"$ref": "../parameters/domain.json"
|
2018-02-03 02:53:40 -06:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"security": [
|
2018-09-20 14:15:17 -05:00
|
|
|
{
|
|
|
|
"ApiKey": []
|
2016-10-22 16:44:14 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2018-08-13 09:17:43 -05:00
|
|
|
"description": "The URL info behind a short code.",
|
2018-02-03 02:53:40 -06:00
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
2018-08-13 09:17:43 -05:00
|
|
|
"$ref": "../definitions/ShortUrl.json"
|
2020-02-02 01:57:04 -06:00
|
|
|
},
|
2021-12-09 08:27:18 -06:00
|
|
|
"example": {
|
|
|
|
"shortCode": "12Kb3",
|
|
|
|
"shortUrl": "https://doma.in/12Kb3",
|
|
|
|
"longUrl": "https://shlink.io",
|
|
|
|
"dateCreated": "2016-05-01T20:34:16+02:00",
|
|
|
|
"visitsCount": 1029,
|
|
|
|
"tags": [
|
|
|
|
"shlink"
|
|
|
|
],
|
|
|
|
"meta": {
|
|
|
|
"validSince": "2017-01-21T00:00:00+02:00",
|
|
|
|
"validUntil": null,
|
|
|
|
"maxVisits": 100
|
|
|
|
},
|
|
|
|
"domain": null,
|
|
|
|
"title": null,
|
|
|
|
"crawlable": false
|
|
|
|
}
|
2017-04-16 03:45:52 -05:00
|
|
|
}
|
2016-10-22 16:44:14 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No URL was found for provided short code.",
|
2018-02-03 02:53:40 -06:00
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2018-02-03 02:53:40 -06:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2016-10-22 16:44:14 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
2018-02-03 02:53:40 -06:00
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2018-02-03 02:53:40 -06:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
2016-10-22 16:44:14 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-01-07 13:54:02 -06:00
|
|
|
},
|
|
|
|
|
2019-05-05 02:21:57 -05:00
|
|
|
"patch": {
|
2018-09-20 13:52:27 -05:00
|
|
|
"operationId": "editShortUrl",
|
2018-01-07 13:54:02 -06:00
|
|
|
"tags": [
|
2018-09-20 13:52:27 -05:00
|
|
|
"Short URLs"
|
2018-01-07 13:54:02 -06:00
|
|
|
],
|
2018-09-24 16:00:06 -05:00
|
|
|
"summary": "Edit short URL",
|
2019-12-31 09:05:02 -06:00
|
|
|
"description": "Update certain meta arguments from an existing short URL.",
|
2018-01-07 13:54:02 -06:00
|
|
|
"parameters": [
|
2019-11-29 12:09:03 -06:00
|
|
|
{
|
|
|
|
"$ref": "../parameters/version.json"
|
|
|
|
},
|
2019-05-05 02:21:57 -05:00
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"description": "The short code to edit.",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
2020-02-02 02:15:43 -06:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "../parameters/domain.json"
|
2019-05-05 02:21:57 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"requestBody": {
|
|
|
|
"description": "Request body.",
|
|
|
|
"required": true,
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
2021-10-02 03:02:43 -05:00
|
|
|
"$ref": "../definitions/ShortUrlEdition.json"
|
2019-05-05 02:21:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"ApiKey": []
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
2021-01-31 06:21:23 -06:00
|
|
|
"200": {
|
|
|
|
"description": "The short URL has been properly updated.",
|
|
|
|
"content": {
|
|
|
|
"application/json": {
|
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/ShortUrl.json"
|
|
|
|
},
|
2021-12-09 08:27:18 -06:00
|
|
|
"example": {
|
|
|
|
"shortCode": "12Kb3",
|
|
|
|
"shortUrl": "https://doma.in/12Kb3",
|
|
|
|
"longUrl": "https://shlink.io",
|
|
|
|
"dateCreated": "2016-05-01T20:34:16+02:00",
|
|
|
|
"visitsCount": 1029,
|
|
|
|
"tags": [
|
|
|
|
"shlink"
|
|
|
|
],
|
|
|
|
"meta": {
|
|
|
|
"validSince": "2017-01-21T00:00:00+02:00",
|
|
|
|
"validUntil": null,
|
|
|
|
"maxVisits": 100
|
|
|
|
},
|
|
|
|
"domain": null,
|
|
|
|
"title": "Shlink - The URL shortener",
|
|
|
|
"crawlable": false
|
|
|
|
}
|
2021-01-31 06:21:23 -06:00
|
|
|
}
|
|
|
|
}
|
2019-05-05 02:21:57 -05:00
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Provided meta arguments are invalid.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2019-05-05 02:21:57 -05:00
|
|
|
"schema": {
|
2019-11-29 12:09:03 -06:00
|
|
|
"type": "object",
|
|
|
|
"allOf": [
|
|
|
|
{
|
2019-11-29 12:24:04 -06:00
|
|
|
"$ref": "../definitions/Error.json"
|
2019-11-29 12:09:03 -06:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"required": ["invalidElements"],
|
|
|
|
"properties": {
|
|
|
|
"invalidElements": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
2020-03-22 08:06:13 -05:00
|
|
|
"longUrl",
|
2019-11-29 12:09:03 -06:00
|
|
|
"validSince",
|
|
|
|
"validUntil",
|
|
|
|
"maxVisits"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2019-05-05 02:21:57 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No short URL was found for provided short code.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2019-05-05 02:21:57 -05:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2019-05-05 02:21:57 -05:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-09-15 06:07:52 -05:00
|
|
|
"delete": {
|
2018-09-20 13:52:27 -05:00
|
|
|
"operationId": "deleteShortUrl",
|
2018-09-15 06:07:52 -05:00
|
|
|
"tags": [
|
2018-09-20 13:52:27 -05:00
|
|
|
"Short URLs"
|
2018-09-15 06:07:52 -05:00
|
|
|
],
|
2018-09-24 16:00:06 -05:00
|
|
|
"summary": "Delete short URL",
|
2019-12-31 09:05:02 -06:00
|
|
|
"description": "Deletes the short URL for provided short code.",
|
2018-09-15 06:07:52 -05:00
|
|
|
"parameters": [
|
2019-11-29 12:09:03 -06:00
|
|
|
{
|
|
|
|
"$ref": "../parameters/version.json"
|
|
|
|
},
|
2018-09-15 06:07:52 -05:00
|
|
|
{
|
|
|
|
"name": "shortCode",
|
|
|
|
"in": "path",
|
|
|
|
"description": "The short code to edit.",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
2020-02-02 02:15:43 -06:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "../parameters/domain.json"
|
2018-09-15 06:07:52 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"security": [
|
2018-09-20 14:15:17 -05:00
|
|
|
{
|
|
|
|
"ApiKey": []
|
2018-09-15 06:07:52 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
2018-09-24 16:00:06 -05:00
|
|
|
"description": "The short URL has been properly deleted."
|
2018-09-15 06:07:52 -05:00
|
|
|
},
|
2019-11-28 12:37:22 -06:00
|
|
|
"422": {
|
2018-09-15 06:07:52 -05:00
|
|
|
"description": "The visits threshold in shlink does not allow this short URL to be deleted.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2018-09-15 06:07:52 -05:00
|
|
|
"schema": {
|
2021-12-09 08:27:18 -06:00
|
|
|
"allOf": [
|
|
|
|
{
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "object",
|
|
|
|
"required": ["shortCode", "threshold"],
|
|
|
|
"properties": {
|
|
|
|
"shortCode": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The short code with which we tried to find the short URL to delete"
|
|
|
|
},
|
|
|
|
"domain": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The domain with which we tried to find the short URL to delete"
|
|
|
|
},
|
|
|
|
"threshold": {
|
|
|
|
"type": "number",
|
|
|
|
"description": "The amount of visits currently configured as threshold to allow deleting short UYRLs or not"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"title": "Cannot delete short URL",
|
|
|
|
"type": "INVALID_SHORTCODE_DELETION",
|
|
|
|
"detail": "Impossible to delete short URL with short code \"abc123\", since it has more than \"15\" visits.",
|
|
|
|
"status": 422,
|
|
|
|
"shortCode": "abc123",
|
|
|
|
"threshold": 15
|
2018-09-15 06:07:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"404": {
|
|
|
|
"description": "No short URL was found for provided short code.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2018-09-15 06:07:52 -05:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"500": {
|
|
|
|
"description": "Unexpected error.",
|
|
|
|
"content": {
|
2019-11-28 12:37:22 -06:00
|
|
|
"application/problem+json": {
|
2018-09-15 06:07:52 -05:00
|
|
|
"schema": {
|
|
|
|
"$ref": "../definitions/Error.json"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-22 16:44:14 -05:00
|
|
|
}
|
|
|
|
}
|