2016-10-23 00:44:14 +03:00
{
"get" : {
2016-10-23 01:07:31 +03:00
"tags" : [
"ShortCodes"
] ,
"summary" : "List short URLs" ,
2016-10-23 00:44:14 +03:00
"description" : "Returns the list of short codes" ,
"parameters" : [
{
"name" : "page" ,
"in" : "query" ,
"description" : "The page to be displayed. Defaults to 1" ,
"required" : false ,
2018-02-03 11:53:40 +03:00
"schema" : {
"type" : "integer"
}
2016-10-23 00:44:14 +03:00
} ,
{
"name" : "searchTerm" ,
"in" : "query" ,
"description" : "A query used to filter results by searching for it on the longUrl and shortCode fields. (Since v1.3.0)" ,
"required" : false ,
2018-02-03 11:53:40 +03:00
"schema" : {
"type" : "string"
}
2016-10-23 00:44:14 +03:00
} ,
{
"name" : "tags" ,
"in" : "query" ,
"description" : "A list of tags used to filter the resultset. Only short URLs tagged with at least one of the provided tags will be returned. (Since v1.3.0)" ,
"required" : false ,
2018-02-03 11:53:40 +03:00
"schema" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
2016-10-23 00:44:14 +03:00
}
} ,
{
"name" : "orderBy" ,
"in" : "query" ,
"description" : "The field from which you want to order the result. (Since v1.3.0)" ,
"required" : false ,
2018-02-03 11:53:40 +03:00
"schema" : {
"type" : "string" ,
"enum" : [
"originalUrl" ,
"shortCode" ,
"dateCreated" ,
"visits"
]
}
}
] ,
"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" : {
"description" : "The list of short URLs" ,
2018-02-03 11:53:40 +03:00
"content" : {
"application/json" : {
"schema" : {
2016-10-23 00:44:14 +03:00
"type" : "object" ,
"properties" : {
2018-02-03 11:53:40 +03:00
"shortUrls" : {
"type" : "object" ,
"properties" : {
"data" : {
"type" : "array" ,
"items" : {
"$ref" : "../definitions/ShortUrl.json"
}
} ,
"pagination" : {
"$ref" : "../definitions/Pagination.json"
}
2016-10-23 00:44:14 +03:00
}
}
}
}
}
2017-04-16 11:27:27 +03:00
} ,
"examples" : {
"application/json" : {
"shortUrls" : {
"data" : [
{
2017-04-16 11:45:52 +03:00
"shortCode" : "12C18" ,
2017-04-16 11:27:27 +03:00
"originalUrl" : "https://store.steampowered.com" ,
"dateCreated" : "2016-08-21T20:34:16+02:00" ,
"visitsCount" : 328 ,
"tags" : [
"games" ,
"tech"
]
2017-04-16 11:45:52 +03:00
} ,
{
"shortCode" : "12Kb3" ,
"originalUrl" : "https://shlink.io" ,
"dateCreated" : "2016-05-01T20:34:16+02:00" ,
"visitsCount" : 1029 ,
"tags" : [
"shlink"
]
} ,
{
"shortCode" : "123bA" ,
"originalUrl" : "https://www.google.com" ,
"dateCreated" : "2015-10-01T20:34:16+02:00" ,
"visitsCount" : 25 ,
"tags" : [ ]
2017-04-16 11:27:27 +03:00
}
] ,
"pagination" : {
"currentPage" : 5 ,
2018-06-17 19:29:40 +03:00
"pagesCount" : 12 ,
"itemsPerPage" : 10 ,
"itemsInCurrentPage" : 10 ,
"totalItems" : 115
2017-04-16 11:27:27 +03:00
}
}
}
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
2016-10-23 00:44:14 +03:00
"post" : {
2016-10-23 01:07:31 +03:00
"tags" : [
"ShortCodes"
] ,
"summary" : "Create short URL" ,
2016-10-23 00:44:14 +03:00
"description" : "Creates a new short code" ,
2018-02-03 11:53:40 +03:00
"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
}
] ,
2018-02-03 11:53:40 +03:00
"requestBody" : {
"description" : "Request body." ,
"required" : true ,
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"required" : [
"longUrl"
] ,
"properties" : {
"longUrl" : {
"description" : "The URL to parse" ,
"type" : "string"
} ,
"tags" : {
"description" : "The URL to parse" ,
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"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"
} ,
"customSlug" : {
"description" : "A unique custom slug to be used instead of the generated short code" ,
"type" : "string"
} ,
"maxVisits" : {
"description" : "The maximum number of allowed visits for this short code" ,
"type" : "number"
}
}
}
}
}
} ,
2016-10-23 00:44:14 +03:00
"responses" : {
"200" : {
"description" : "The result of parsing the long URL" ,
2018-02-03 11:53:40 +03:00
"content" : {
"application/json" : {
"schema" : {
"type" : "object" ,
"properties" : {
"longUrl" : {
"type" : "string" ,
"description" : "The original long URL that has been parsed"
} ,
"shortUrl" : {
"type" : "string" ,
"description" : "The generated short URL"
} ,
"shortCode" : {
"type" : "string" ,
"description" : "the short code that is being used in the short URL"
}
}
2016-10-23 00:44:14 +03:00
}
}
}
} ,
"400" : {
"description" : "The long URL was not provided or is invalid." ,
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
}
}
}
}
}