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 ,
"type" : "integer"
} ,
{
"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 ,
"type" : "string"
} ,
{
"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 ,
"type" : "array" ,
2016-10-29 13:42:36 +03:00
"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)" ,
"enum" : [
"originalUrl" ,
"shortCode" ,
"dateCreated" ,
"visits"
] ,
"required" : false ,
"type" : "string"
} ,
{
"$ref" : "../parameters/Authorization.json"
}
] ,
"responses" : {
"200" : {
"description" : "The list of short URLs" ,
"schema" : {
"type" : "object" ,
"properties" : {
"shortUrls" : {
"type" : "object" ,
"properties" : {
"data" : {
"type" : "array" ,
"items" : {
"$ref" : "../definitions/ShortUrl.json"
}
} ,
"pagination" : {
"$ref" : "../definitions/Pagination.json"
}
}
}
}
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 ,
"pagesCount" : 12
}
}
}
2016-10-23 00:44:14 +03:00
}
} ,
"500" : {
"description" : "Unexpected error." ,
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
} ,
"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" ,
"parameters" : [
{
"name" : "longUrl" ,
"in" : "formData" ,
"description" : "The URL to parse" ,
"required" : true ,
"type" : "string"
} ,
{
"name" : "tags" ,
"in" : "formData" ,
"description" : "The URL to parse" ,
"required" : false ,
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
{
"$ref" : "../parameters/Authorization.json"
}
] ,
"responses" : {
"200" : {
"description" : "The result of parsing the long URL" ,
"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"
}
}
}
} ,
"400" : {
"description" : "The long URL was not provided or is invalid." ,
"schema" : {
"$ref" : "../definitions/Error.json"
}
} ,
"500" : {
"description" : "Unexpected error." ,
"schema" : {
"$ref" : "../definitions/Error.json"
}
}
}
}
}