mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 11:49:05 +03:00
commit
f96d0fe30a
8 changed files with 496 additions and 279 deletions
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Authorization",
|
|
||||||
"in": "header",
|
|
||||||
"description": "The authorization token with Bearer type",
|
|
||||||
"required": true,
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
|
@ -5,24 +5,39 @@
|
||||||
],
|
],
|
||||||
"summary": "Perform authentication",
|
"summary": "Perform authentication",
|
||||||
"description": "Performs an authentication",
|
"description": "Performs an authentication",
|
||||||
"parameters": [
|
"requestBody": {
|
||||||
{
|
"description": "Request body.",
|
||||||
"name": "apiKey",
|
"required": true,
|
||||||
"in": "formData",
|
"content": {
|
||||||
"description": "The API key to authenticate with",
|
"application/json": {
|
||||||
"required": true,
|
"schema": {
|
||||||
"type": "string"
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"apiKey"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"apiKey": {
|
||||||
|
"description": "The API key to authenticate with",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The authentication worked.",
|
"description": "The authentication worked.",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"token": {
|
"type": "object",
|
||||||
"type": "string",
|
"properties": {
|
||||||
"description": "The authentication token that needs to be sent in the Authorization header"
|
"token": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The authentication token that needs to be sent in the Authorization header"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -34,20 +49,32 @@
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "An API key was not provided.",
|
"description": "An API key was not provided.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"401": {
|
"401": {
|
||||||
"description": "The API key is incorrect, is disabled or has expired.",
|
"description": "The API key is incorrect, is disabled or has expired.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,59 +11,73 @@
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"description": "The page to be displayed. Defaults to 1",
|
"description": "The page to be displayed. Defaults to 1",
|
||||||
"required": false,
|
"required": false,
|
||||||
"type": "integer"
|
"schema": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "searchTerm",
|
"name": "searchTerm",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"description": "A query used to filter results by searching for it on the longUrl and shortCode fields. (Since v1.3.0)",
|
"description": "A query used to filter results by searching for it on the longUrl and shortCode fields. (Since v1.3.0)",
|
||||||
"required": false,
|
"required": false,
|
||||||
"type": "string"
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tags",
|
"name": "tags",
|
||||||
"in": "query",
|
"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)",
|
"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,
|
"required": false,
|
||||||
"type": "array",
|
"schema": {
|
||||||
"items": {
|
"type": "array",
|
||||||
"type": "string"
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "orderBy",
|
"name": "orderBy",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"description": "The field from which you want to order the result. (Since v1.3.0)",
|
"description": "The field from which you want to order the result. (Since v1.3.0)",
|
||||||
"enum": [
|
|
||||||
"originalUrl",
|
|
||||||
"shortCode",
|
|
||||||
"dateCreated",
|
|
||||||
"visits"
|
|
||||||
],
|
|
||||||
"required": false,
|
"required": false,
|
||||||
"type": "string"
|
"schema": {
|
||||||
},
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"originalUrl",
|
||||||
|
"shortCode",
|
||||||
|
"dateCreated",
|
||||||
|
"visits"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The list of short URLs",
|
"description": "The list of short URLs",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"shortUrls": {
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"data": {
|
"shortUrls": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"$ref": "../definitions/ShortUrl.json"
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "../definitions/ShortUrl.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pagination": {
|
||||||
|
"$ref": "../definitions/Pagination.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"pagination": {
|
|
||||||
"$ref": "../definitions/Pagination.json"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,8 +124,12 @@
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,87 +141,97 @@
|
||||||
],
|
],
|
||||||
"summary": "Create short URL",
|
"summary": "Create short URL",
|
||||||
"description": "Creates a new short code",
|
"description": "Creates a new short code",
|
||||||
"parameters": [
|
"security": [
|
||||||
{
|
{
|
||||||
"name": "longUrl",
|
"Bearer": []
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "validSince",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The date (in ISO-8601 format) from which this short code will be valid",
|
|
||||||
"required": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "validUntil",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The date (in ISO-8601 format) until which this short code will be valid",
|
|
||||||
"required": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "customSlug",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "A unique custom slug to be used instead of the generated short code",
|
|
||||||
"required": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "maxVisits",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The maximum number of allowed visits for this short code",
|
|
||||||
"required": false,
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "../parameters/Authorization.json"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The result of parsing the long URL",
|
"description": "The result of parsing the long URL",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"longUrl": {
|
"type": "object",
|
||||||
"type": "string",
|
"properties": {
|
||||||
"description": "The original long URL that has been parsed"
|
"longUrl": {
|
||||||
},
|
"type": "string",
|
||||||
"shortUrl": {
|
"description": "The original long URL that has been parsed"
|
||||||
"type": "string",
|
},
|
||||||
"description": "The generated short URL"
|
"shortUrl": {
|
||||||
},
|
"type": "string",
|
||||||
"shortCode": {
|
"description": "The generated short URL"
|
||||||
"type": "string",
|
},
|
||||||
"description": "the short code that is being used in the short URL"
|
"shortCode": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "the short code that is being used in the short URL"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "The long URL was not provided or is invalid.",
|
"description": "The long URL was not provided or is invalid.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,23 +9,31 @@
|
||||||
{
|
{
|
||||||
"name": "shortCode",
|
"name": "shortCode",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"type": "string",
|
|
||||||
"description": "The short code to resolve.",
|
"description": "The short code to resolve.",
|
||||||
"required": true
|
"required": true,
|
||||||
},
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The long URL behind a short code.",
|
"description": "The long URL behind a short code.",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"longUrl": {
|
"type": "object",
|
||||||
"type": "string",
|
"properties": {
|
||||||
"description": "The original long URL behind the short code."
|
"longUrl": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The original long URL behind the short code."
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -37,20 +45,32 @@
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Provided shortCode does not match the character set currently used by the app to generate short codes.",
|
"description": "Provided shortCode does not match the character set currently used by the app to generate short codes.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "No URL was found for provided short code.",
|
"description": "No URL was found for provided short code.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,33 +86,41 @@
|
||||||
{
|
{
|
||||||
"name": "shortCode",
|
"name": "shortCode",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"type": "string",
|
|
||||||
"description": "The short code to edit.",
|
"description": "The short code to edit.",
|
||||||
"required": true
|
"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": [
|
||||||
{
|
{
|
||||||
"name": "validSince",
|
"Bearer": []
|
||||||
"in": "formData",
|
|
||||||
"description": "The date (in ISO-8601 format) from which this short code will be valid",
|
|
||||||
"required": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "validUntil",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The date (in ISO-8601 format) until which this short code will be valid",
|
|
||||||
"required": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "maxVisits",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The maximum number of allowed visits for this short code",
|
|
||||||
"required": false,
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$ref": "../parameters/Authorization.json"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -101,20 +129,32 @@
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Provided meta arguments are invalid.",
|
"description": "Provided meta arguments are invalid.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "No short URL was found for provided short code.",
|
"description": "No short URL was found for provided short code.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,34 +10,55 @@
|
||||||
{
|
{
|
||||||
"name": "shortCode",
|
"name": "shortCode",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"type": "string",
|
|
||||||
"description": "The shortCode in which we want to edit tags.",
|
"description": "The shortCode in which we want to edit tags.",
|
||||||
"required": true
|
"required": true,
|
||||||
},
|
"schema": {
|
||||||
{
|
|
||||||
"name": "tags",
|
|
||||||
"in": "formData",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
}
|
||||||
"description": "The list of tags to set to the short URL.",
|
}
|
||||||
"required": true
|
],
|
||||||
},
|
"requestBody": {
|
||||||
|
"description": "Request body.",
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"tags"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"tags": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "The list of tags to set to the short URL."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "List of tags.",
|
"description": "List of tags.",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"tags": {
|
"type": "object",
|
||||||
"type": "array",
|
"properties": {
|
||||||
"items": {
|
"tags": {
|
||||||
"type": "string"
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,20 +74,32 @@
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "The request body does not contain a \"tags\" param with array type.",
|
"description": "The request body does not contain a \"tags\" param with array type.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "No short URL was found for provided short code.",
|
"description": "No short URL was found for provided short code.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,27 +10,35 @@
|
||||||
{
|
{
|
||||||
"name": "shortCode",
|
"name": "shortCode",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"type": "string",
|
|
||||||
"description": "The shortCode from which we want to get the visits.",
|
"description": "The shortCode from which we want to get the visits.",
|
||||||
"required": true
|
"required": true,
|
||||||
},
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "List of visits.",
|
"description": "List of visits.",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"visits": {
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"data": {
|
"visits": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"$ref": "../definitions/Visit.json"
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "../definitions/Visit.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,14 +74,22 @@
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "The short code does not belong to any short URL.",
|
"description": "The short code does not belong to any short URL.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,24 +5,28 @@
|
||||||
],
|
],
|
||||||
"summary": "List existing tags",
|
"summary": "List existing tags",
|
||||||
"description": "Returns the list of all tags used in any short URL, ordered by name",
|
"description": "Returns the list of all tags used in any short URL, ordered by name",
|
||||||
"parameters": [
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The list of tags",
|
"description": "The list of tags",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"tags": {
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"data": {
|
"tags": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"type": "string"
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,8 +48,12 @@
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,31 +65,51 @@
|
||||||
],
|
],
|
||||||
"summary": "Create tags",
|
"summary": "Create tags",
|
||||||
"description": "Provided a list of tags, creates all that do not yet exist",
|
"description": "Provided a list of tags, creates all that do not yet exist",
|
||||||
"parameters": [
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tags[]",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "The list of tag names to create",
|
|
||||||
"required": true,
|
|
||||||
"type": "array"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"description": "Request body.",
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"tags"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"tags": {
|
||||||
|
"description": "The list of tag names to create",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The list of tags",
|
"description": "The list of tags",
|
||||||
"schema": {
|
"content": {
|
||||||
"type": "object",
|
"application/json": {
|
||||||
"properties": {
|
"schema": {
|
||||||
"tags": {
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"data": {
|
"tags": {
|
||||||
"type": "array",
|
"type": "object",
|
||||||
"items": {
|
"properties": {
|
||||||
"type": "string"
|
"data": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,8 +131,12 @@
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,45 +148,68 @@
|
||||||
],
|
],
|
||||||
"summary": "Rename tag",
|
"summary": "Rename tag",
|
||||||
"description": "Renames one existing tag",
|
"description": "Renames one existing tag",
|
||||||
"parameters": [
|
"security": [
|
||||||
{
|
{
|
||||||
"$ref": "../parameters/Authorization.json"
|
"Bearer": []
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "oldName",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "Current name of the tag",
|
|
||||||
"required": true,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "newName",
|
|
||||||
"in": "formData",
|
|
||||||
"description": "New name of the tag",
|
|
||||||
"required": true,
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"description": "Request body.",
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"oldName",
|
||||||
|
"newName"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"oldName": {
|
||||||
|
"description": "Current name of the tag",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"newName": {
|
||||||
|
"description": "New name of the tag",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"204": {
|
||||||
"description": "The tag has been properly renamed"
|
"description": "The tag has been properly renamed"
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "You have not provided either the oldName or the newName params.",
|
"description": "You have not provided either the oldName or the newName params.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"404": {
|
"404": {
|
||||||
"description": "There's no tag found with the name provided in oldName param.",
|
"description": "There's no tag found with the name provided in oldName param.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,15 +222,22 @@
|
||||||
"summary": "Delete tags",
|
"summary": "Delete tags",
|
||||||
"description": "Deletes provided list of tags",
|
"description": "Deletes provided list of tags",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
|
||||||
"$ref": "../parameters/Authorization.json"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "tags[]",
|
"name": "tags[]",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"description": "The names of the tags to delete",
|
"description": "The names of the tags to delete",
|
||||||
"required": true,
|
"required": true,
|
||||||
"type": "array"
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -184,8 +246,12 @@
|
||||||
},
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Unexpected error.",
|
"description": "Unexpected error.",
|
||||||
"schema": {
|
"content": {
|
||||||
"$ref": "../definitions/Error.json"
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "../definitions/Error.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,37 @@
|
||||||
{
|
{
|
||||||
"swagger": "2.0",
|
"openapi": "3.0.0",
|
||||||
"info": {
|
"info": {
|
||||||
"title": "Shlink",
|
"title": "Shlink",
|
||||||
"description": "Shlink, the self-hosted URL shortener",
|
"description": "Shlink, the self-hosted URL shortener",
|
||||||
"version": "1.0"
|
"version": "1.0"
|
||||||
},
|
},
|
||||||
"schemes": [
|
|
||||||
"http",
|
"servers": [
|
||||||
"https"
|
{
|
||||||
],
|
"url": "{schema}://{server}/rest",
|
||||||
"basePath": "/rest",
|
"variables": {
|
||||||
"produces": [
|
"schema": {
|
||||||
"application/json"
|
"default": "https",
|
||||||
],
|
"enum": ["https", "http"]
|
||||||
"consumes": [
|
},
|
||||||
"application/x-www-form-urlencoded",
|
"server": {
|
||||||
"application/json"
|
"default": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"components": {
|
||||||
|
"securitySchemes": {
|
||||||
|
"Bearer": {
|
||||||
|
"description": "The JWT identifying a previously logged API key",
|
||||||
|
"type": "http",
|
||||||
|
"scheme": "bearer",
|
||||||
|
"bearerFormat": "JWT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"/v1/authenticate": {
|
"/v1/authenticate": {
|
||||||
"$ref": "paths/v1_authenticate.json"
|
"$ref": "paths/v1_authenticate.json"
|
||||||
|
|
Loading…
Add table
Reference in a new issue