2016-10-23 00:44:14 +03:00
{
"get" : {
2018-09-20 21:52:27 +03:00
"operationId" : "getShortUrl" ,
2016-10-23 01:07:31 +03:00
"tags" : [
2018-09-20 21:52:27 +03:00
"Short URLs"
2016-10-23 01:07:31 +03:00
] ,
"summary" : "Parse short code" ,
2018-09-25 00:00:06 +03:00
"description" : "Get the long URL behind a short URL's short code.<br><br>**Important note**: Before shlink v1.13, this endpoint used to use the `/short-codes` path instead of `/short-urls`. Both of them will keep working, while the first one is considered deprecated." ,
2016-10-23 00:44:14 +03:00
"parameters" : [
2019-11-29 21:09:03 +03:00
{
"$ref" : "../parameters/version.json"
} ,
2016-10-23 00:44:14 +03:00
{
"name" : "shortCode" ,
"in" : "path" ,
"description" : "The short code to resolve." ,
2018-02-03 11:53:40 +03:00
"required" : true ,
"schema" : {
"type" : "string"
}
2019-10-04 22:17:02 +03:00
} ,
{
"name" : "domain" ,
"in" : "query" ,
"description" : "The domain in which the short code should be searched for. Will fall back to default domain if not found." ,
"required" : false ,
"schema" : {
"type" : "string"
}
2018-02-03 11:53:40 +03:00
}
] ,
"security" : [
2018-09-20 22:15:17 +03:00
{
"ApiKey" : [ ]
} ,
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"
2019-07-08 19:42:53 +03:00
] ,
"meta" : {
"validSince" : "2017-01-21T00:00:00+02:00" ,
"validUntil" : null ,
"maxVisits" : 100
}
2017-04-16 11:45:52 +03:00
}
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" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-02-03 11:53:40 +03:00
"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" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-02-03 11:53:40 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
2016-10-23 00:44:14 +03:00
}
}
}
2018-01-07 22:54:02 +03:00
} ,
2019-05-05 10:21:57 +03:00
"patch" : {
2018-09-20 21:52:27 +03:00
"operationId" : "editShortUrl" ,
2018-01-07 22:54:02 +03:00
"tags" : [
2018-09-20 21:52:27 +03:00
"Short URLs"
2018-01-07 22:54:02 +03:00
] ,
2018-09-25 00:00:06 +03:00
"summary" : "Edit short URL" ,
2018-09-24 23:49:30 +03:00
"description" : "Update certain meta arguments from an existing short URL.<br><br>**Important note**: Before shlink v1.13, this endpoint used to use the `/short-codes` path instead of `/short-urls`. Both of them will keep working, while the first one is considered deprecated." ,
2018-01-07 22:54:02 +03:00
"parameters" : [
2019-11-29 21:09:03 +03:00
{
"$ref" : "../parameters/version.json"
} ,
2019-05-05 10:21:57 +03:00
{
"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" : [
{
"ApiKey" : [ ]
} ,
{
"Bearer" : [ ]
}
] ,
"responses" : {
"204" : {
"description" : "The short code has been properly updated."
} ,
"400" : {
"description" : "Provided meta arguments are invalid." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2019-05-05 10:21:57 +03:00
"schema" : {
2019-11-29 21:09:03 +03:00
"type" : "object" ,
"allOf" : [
{
2019-11-29 21:24:04 +03:00
"$ref" : "../definitions/Error.json"
2019-11-29 21:09:03 +03:00
} ,
{
"type" : "object" ,
"required" : [ "invalidElements" ] ,
"properties" : {
"invalidElements" : {
"type" : "array" ,
"items" : {
"type" : "string" ,
"enum" : [
"validSince" ,
"validUntil" ,
"maxVisits"
]
}
}
}
}
]
2019-05-05 10:21:57 +03:00
}
}
}
} ,
"404" : {
"description" : "No short URL was found for provided short code." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2019-05-05 10:21:57 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
} ,
"500" : {
"description" : "Unexpected error." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2019-05-05 10:21:57 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
}
}
} ,
"put" : {
"deprecated" : true ,
"operationId" : "editShortUrlPut" ,
"tags" : [
"Short URLs"
] ,
"summary" : "[DEPRECATED] Edit short URL" ,
"description" : "**[DEPRECATED]** Use [editShortUrl](#/Short_URLs/getShortUrl) instead" ,
"parameters" : [
2019-11-29 21:09:03 +03:00
{
"$ref" : "../parameters/version.json"
} ,
2018-01-07 22:54:02 +03:00
{
"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-09-20 22:15:17 +03:00
{
"ApiKey" : [ ]
} ,
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" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-02-03 11:53:40 +03:00
"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" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-02-03 11:53:40 +03:00
"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" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-02-03 11:53:40 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
2018-01-07 22:54:02 +03:00
}
}
}
2018-09-15 14:07:52 +03:00
} ,
"delete" : {
2018-09-20 21:52:27 +03:00
"operationId" : "deleteShortUrl" ,
2018-09-15 14:07:52 +03:00
"tags" : [
2018-09-20 21:52:27 +03:00
"Short URLs"
2018-09-15 14:07:52 +03:00
] ,
2018-09-25 00:00:06 +03:00
"summary" : "Delete short URL" ,
2018-09-24 23:49:30 +03:00
"description" : "Deletes the short URL for provided short code.<br><br>**Important note**: Before shlink v1.13, this endpoint used to use the `/short-codes` path instead of `/short-urls`. Both of them will keep working, while the first one is considered deprecated." ,
2018-09-15 14:07:52 +03:00
"parameters" : [
2019-11-29 21:09:03 +03:00
{
"$ref" : "../parameters/version.json"
} ,
2018-09-15 14:07:52 +03:00
{
"name" : "shortCode" ,
"in" : "path" ,
"description" : "The short code to edit." ,
"required" : true ,
"schema" : {
"type" : "string"
}
}
] ,
"security" : [
2018-09-20 22:15:17 +03:00
{
"ApiKey" : [ ]
} ,
2018-09-15 14:07:52 +03:00
{
"Bearer" : [ ]
}
] ,
"responses" : {
"204" : {
2018-09-25 00:00:06 +03:00
"description" : "The short URL has been properly deleted."
2018-09-15 14:07:52 +03:00
} ,
2019-11-28 21:37:22 +03:00
"422" : {
2018-09-15 14:07:52 +03:00
"description" : "The visits threshold in shlink does not allow this short URL to be deleted." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-09-15 14:07:52 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
} ,
"examples" : {
2019-11-28 21:37:22 +03: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 14:07:52 +03:00
}
}
} ,
"404" : {
"description" : "No short URL was found for provided short code." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-09-15 14:07:52 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
} ,
"500" : {
"description" : "Unexpected error." ,
"content" : {
2019-11-28 21:37:22 +03:00
"application/problem+json" : {
2018-09-15 14:07:52 +03:00
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
}
}
2016-10-23 00:44:14 +03:00
}
}