Document short URLs visits deletion endpoint

This commit is contained in:
Alejandro Celaya 2023-05-14 18:25:21 +02:00
parent 0365728337
commit 3cf253fd0f
6 changed files with 90 additions and 49 deletions

View file

@ -0,0 +1,9 @@
{
"name": "shortCode",
"in": "path",
"description": "The short code for the short URL.",
"required": true,
"schema": {
"type": "string"
}
}

View file

@ -11,13 +11,7 @@
"$ref": "../parameters/version.json"
},
{
"name": "shortCode",
"in": "path",
"description": "The short code to resolve.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
},
{
"$ref": "../parameters/domain.json"
@ -127,13 +121,7 @@
"$ref": "../parameters/version.json"
},
{
"name": "shortCode",
"in": "path",
"description": "The short code to edit.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
},
{
"$ref": "../parameters/domain.json"
@ -295,13 +283,7 @@
"$ref": "../parameters/version.json"
},
{
"name": "shortCode",
"in": "path",
"description": "The short code to edit.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
},
{
"$ref": "../parameters/domain.json"

View file

@ -11,13 +11,7 @@
"$ref": "../parameters/version.json"
},
{
"name": "shortCode",
"in": "path",
"description": "The short code for the short URL from which we want to get the visits.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
},
{
"$ref": "../parameters/domain.json"
@ -172,5 +166,79 @@
}
}
}
},
"delete": {
"operationId": "deleteShortUrlVisits",
"tags": [
"Visits"
],
"summary": "Delete visits for short URL",
"description": "Delete all existing visits on the short URL behind provided short code.",
"parameters": [
{
"$ref": "../parameters/version.json"
},
{
"$ref": "../parameters/shortCode.json"
},
{
"$ref": "../parameters/domain.json"
}
],
"security": [
{
"ApiKey": []
}
],
"responses": {
"200": {
"description": "Deleted visits",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"deletedVisits": {
"description": "Amount of affected visits",
"type": "number"
}
}
},
"example": {
"deletedVisits": 536
}
}
}
},
"404": {
"description": "The short code does not belong to any short URL.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
},
"examples": {
"Short URL not found with API v3 and newer": {
"$ref": "../examples/short-url-not-found-v3.json"
},
"Short URL not found previous to API v3": {
"$ref": "../examples/short-url-not-found-v2.json"
}
}
}
}
},
"default": {
"description": "Unexpected error.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}
}

View file

@ -8,13 +8,7 @@
"description": "Represents a short URL. Tracks the visit and redirects tio the corresponding long URL",
"parameters": [
{
"name": "shortCode",
"in": "path",
"description": "The short code to resolve.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
}
],
"responses": {

View file

@ -8,13 +8,7 @@
"description": "Generates a QR code image pointing to a short URL.<br />Since this is not an API endpoint but an image one, when an invalid value is provided for any of the query params, they will fall to their default values instead of throwing an error.",
"parameters": [
{
"name": "shortCode",
"in": "path",
"description": "The short code to resolve.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
},
{
"name": "size",

View file

@ -8,13 +8,7 @@
"description": "Generates a 1px transparent image which can be used to track emails with a short URL",
"parameters": [
{
"name": "shortCode",
"in": "path",
"description": "The short code to resolve.",
"required": true,
"schema": {
"type": "string"
}
"$ref": "../parameters/shortCode.json"
}
],
"responses": {