diff --git a/docs/swagger/definitions/VisitStats.json b/docs/swagger/definitions/VisitStats.json new file mode 100644 index 00000000..5f439c9b --- /dev/null +++ b/docs/swagger/definitions/VisitStats.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "required": ["visitsCount"], + "properties": { + "visitsCount": { + "type": "number", + "description": "The total amount of visits received." + } + } +} diff --git a/docs/swagger/paths/v2_visits.json b/docs/swagger/paths/v2_visits.json new file mode 100644 index 00000000..089223b3 --- /dev/null +++ b/docs/swagger/paths/v2_visits.json @@ -0,0 +1,54 @@ +{ + "get": { + "operationId": "getGlobalVisits", + "tags": [ + "Visits" + ], + "summary": "Get general visits stats", + "description": "Get general visits stats not linked to one specific short URL.", + "parameters": [ + { + "$ref": "../parameters/version.json" + } + ], + "security": [ + { + "ApiKey": [] + } + ], + "responses": { + "200": { + "description": "Visits stats.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "visits": { + "$ref": "../definitions/VisitStats.json" + } + } + } + } + }, + "examples": { + "application/json": { + "visits": { + "visitsCount": 1569874 + } + } + } + }, + "500": { + "description": "Unexpected error.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "../definitions/Error.json" + } + } + } + } + } + } +} diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index c30bab97..e7663820 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -78,6 +78,9 @@ "$ref": "paths/v1_tags.json" }, + "/rest/v{version}/visits": { + "$ref": "paths/v2_visits.json" + }, "/rest/v{version}/short-urls/{shortCode}/visits": { "$ref": "paths/v1_short-urls_{shortCode}_visits.json" },