2016-10-22 23:44:14 +02:00
{
"get" : {
2018-09-20 20:52:27 +02:00
"operationId" : "getShortUrl" ,
2016-10-23 00:07:31 +02:00
"tags" : [
2018-09-20 20:52:27 +02:00
"Short URLs"
2016-10-23 00:07:31 +02:00
] ,
"summary" : "Parse short code" ,
2019-12-31 16:05:02 +01:00
"description" : "Get the long URL behind a short URL's short code." ,
2016-10-22 23:44:14 +02:00
"parameters" : [
2019-11-29 19:09:03 +01:00
{
"$ref" : "../parameters/version.json"
} ,
2016-10-22 23:44:14 +02:00
{
"name" : "shortCode" ,
"in" : "path" ,
"description" : "The short code to resolve." ,
2018-02-03 09:53:40 +01:00
"required" : true ,
"schema" : {
"type" : "string"
}
2019-10-04 21:17:02 +02:00
} ,
{
2020-02-02 09:15:43 +01:00
"$ref" : "../parameters/domain.json"
2018-02-03 09:53:40 +01:00
}
] ,
"security" : [
2018-09-20 21:15:17 +02:00
{
"ApiKey" : [ ]
2016-10-22 23:44:14 +02:00
}
] ,
"responses" : {
"200" : {
2018-08-13 16:17:43 +02:00
"description" : "The URL info behind a short code." ,
2018-02-03 09:53:40 +01:00
"content" : {
"application/json" : {
"schema" : {
2018-08-13 16:17:43 +02:00
"$ref" : "../definitions/ShortUrl.json"
2016-10-22 23:44:14 +02:00
}
}
2017-04-16 10:45:52 +02:00
} ,
"examples" : {
"application/json" : {
2018-08-13 16:17:43 +02:00
"shortCode" : "12Kb3" ,
"shortUrl" : "https://doma.in/12Kb3" ,
"longUrl" : "https://shlink.io" ,
"dateCreated" : "2016-05-01T20:34:16+02:00" ,
"visitsCount" : 1029 ,
"tags" : [
"shlink"
2019-07-08 18:42:53 +02:00
] ,
"meta" : {
"validSince" : "2017-01-21T00:00:00+02:00" ,
"validUntil" : null ,
"maxVisits" : 100
2020-02-02 08:57:04 +01:00
} ,
2021-02-02 20:51:28 +01:00
"domain" : null ,
2021-05-22 07:32:47 +02:00
"title" : null ,
"crawlable" : false
2017-04-16 10:45:52 +02:00
}
2016-10-22 23:44:14 +02:00
}
} ,
"404" : {
"description" : "No URL was found for provided short code." ,
2018-02-03 09:53:40 +01:00
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2018-02-03 09:53:40 +01:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
2016-10-22 23:44:14 +02:00
}
} ,
"500" : {
"description" : "Unexpected error." ,
2018-02-03 09:53:40 +01:00
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2018-02-03 09:53:40 +01:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
2016-10-22 23:44:14 +02:00
}
}
}
2018-01-07 20:54:02 +01:00
} ,
2019-05-05 09:21:57 +02:00
"patch" : {
2018-09-20 20:52:27 +02:00
"operationId" : "editShortUrl" ,
2018-01-07 20:54:02 +01:00
"tags" : [
2018-09-20 20:52:27 +02:00
"Short URLs"
2018-01-07 20:54:02 +01:00
] ,
2018-09-24 23:00:06 +02:00
"summary" : "Edit short URL" ,
2019-12-31 16:05:02 +01:00
"description" : "Update certain meta arguments from an existing short URL." ,
2018-01-07 20:54:02 +01:00
"parameters" : [
2019-11-29 19:09:03 +01:00
{
"$ref" : "../parameters/version.json"
} ,
2019-05-05 09:21:57 +02:00
{
"name" : "shortCode" ,
"in" : "path" ,
"description" : "The short code to edit." ,
"required" : true ,
"schema" : {
"type" : "string"
}
2020-02-02 09:15:43 +01:00
} ,
{
"$ref" : "../parameters/domain.json"
2019-05-05 09:21:57 +02:00
}
] ,
"requestBody" : {
"description" : "Request body." ,
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"properties" : {
2020-03-22 14:06:13 +01:00
"longUrl" : {
"description" : "The long URL this short URL will redirect to" ,
"type" : "string"
} ,
2019-05-05 09:21:57 +02:00
"validSince" : {
"description" : "The date (in ISO-8601 format) from which this short code will be valid" ,
2021-02-02 20:51:28 +01:00
"type" : "string" ,
"nullable" : true
2019-05-05 09:21:57 +02:00
} ,
"validUntil" : {
"description" : "The date (in ISO-8601 format) until which this short code will be valid" ,
2021-02-02 20:51:28 +01:00
"type" : "string" ,
"nullable" : true
2019-05-05 09:21:57 +02:00
} ,
"maxVisits" : {
"description" : "The maximum number of allowed visits for this short code" ,
2021-02-02 20:51:28 +01:00
"type" : "number" ,
"nullable" : true
2020-09-23 19:24:15 +02:00
} ,
"validateUrl" : {
"description" : "Tells if the long URL (if provided) should or should not be validated as a reachable URL. If not provided, it will fall back to app-level config" ,
"type" : "boolean"
2021-01-31 12:24:26 +01:00
} ,
"tags" : {
"type" : "array" ,
"items" : {
"type" : "string"
} ,
"description" : "The list of tags to set to the short URL."
2021-02-02 20:51:28 +01:00
} ,
"title" : {
"type" : "string" ,
"description" : "A descriptive title of the short URL." ,
"nullable" : true
2021-05-22 07:40:21 +02:00
} ,
"crawlable" : {
"type" : "boolean" ,
"description" : "Tells if this URL will be included as 'Allow' in Shlink's robots.txt."
2019-05-05 09:21:57 +02:00
}
}
}
}
}
} ,
"security" : [
{
"ApiKey" : [ ]
}
] ,
"responses" : {
2021-01-31 13:21:23 +01:00
"200" : {
"description" : "The short URL has been properly updated." ,
"content" : {
"application/json" : {
"schema" : {
"$ref" : "../definitions/ShortUrl.json"
}
}
} ,
"examples" : {
"application/json" : {
"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
} ,
2021-02-02 20:51:28 +01:00
"domain" : null ,
2021-05-22 07:32:47 +02:00
"title" : "Shlink - The URL shortener" ,
"crawlable" : false
2021-01-31 13:21:23 +01:00
}
}
2019-05-05 09:21:57 +02:00
} ,
"400" : {
"description" : "Provided meta arguments are invalid." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2019-05-05 09:21:57 +02:00
"schema" : {
2019-11-29 19:09:03 +01:00
"type" : "object" ,
"allOf" : [
{
2019-11-29 19:24:04 +01:00
"$ref" : "../definitions/Error.json"
2019-11-29 19:09:03 +01:00
} ,
{
"type" : "object" ,
"required" : [ "invalidElements" ] ,
"properties" : {
"invalidElements" : {
"type" : "array" ,
"items" : {
"type" : "string" ,
"enum" : [
2020-03-22 14:06:13 +01:00
"longUrl" ,
2019-11-29 19:09:03 +01:00
"validSince" ,
"validUntil" ,
"maxVisits"
]
}
}
}
}
]
2019-05-05 09:21:57 +02:00
}
}
}
} ,
"404" : {
"description" : "No short URL was found for provided short code." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2019-05-05 09:21:57 +02:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
} ,
"500" : {
"description" : "Unexpected error." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2019-05-05 09:21:57 +02:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
}
}
} ,
2018-09-15 13:07:52 +02:00
"delete" : {
2018-09-20 20:52:27 +02:00
"operationId" : "deleteShortUrl" ,
2018-09-15 13:07:52 +02:00
"tags" : [
2018-09-20 20:52:27 +02:00
"Short URLs"
2018-09-15 13:07:52 +02:00
] ,
2018-09-24 23:00:06 +02:00
"summary" : "Delete short URL" ,
2019-12-31 16:05:02 +01:00
"description" : "Deletes the short URL for provided short code." ,
2018-09-15 13:07:52 +02:00
"parameters" : [
2019-11-29 19:09:03 +01:00
{
"$ref" : "../parameters/version.json"
} ,
2018-09-15 13:07:52 +02:00
{
"name" : "shortCode" ,
"in" : "path" ,
"description" : "The short code to edit." ,
"required" : true ,
"schema" : {
"type" : "string"
}
2020-02-02 09:15:43 +01:00
} ,
{
"$ref" : "../parameters/domain.json"
2018-09-15 13:07:52 +02:00
}
] ,
"security" : [
2018-09-20 21:15:17 +02:00
{
"ApiKey" : [ ]
2018-09-15 13:07:52 +02:00
}
] ,
"responses" : {
"204" : {
2018-09-24 23:00:06 +02:00
"description" : "The short URL has been properly deleted."
2018-09-15 13:07:52 +02:00
} ,
2019-11-28 19:37:22 +01:00
"422" : {
2018-09-15 13:07:52 +02:00
"description" : "The visits threshold in shlink does not allow this short URL to be deleted." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2018-09-15 13:07:52 +02:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
} ,
"examples" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
"title" : "Cannot delete short URL" ,
"type" : "INVALID_SHORTCODE_DELETION" ,
"detail" : "It is not possible to delete URL with short code \"abc123\" because it has reached more than \"15\" visits." ,
"status" : 422
2018-09-15 13:07:52 +02:00
}
}
} ,
"404" : {
"description" : "No short URL was found for provided short code." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2018-09-15 13:07:52 +02:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
} ,
"500" : {
"description" : "Unexpected error." ,
"content" : {
2019-11-28 19:37:22 +01:00
"application/problem+json" : {
2018-09-15 13:07:52 +02:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
}
}
2016-10-22 23:44:14 +02:00
}
}