From 09078e4c6ac413b4e8580dfed806edda8277e050 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Fri, 16 Dec 2022 13:34:34 +0100 Subject: [PATCH] Updated short URL API docs including new visitsSummary --- docs/swagger/definitions/ShortUrl.json | 7 +++++- .../definitions/ShortUrlVisitsSummary.json | 18 ++++++++++++++ docs/swagger/paths/v1_short-urls.json | 24 +++++++++++++++---- docs/swagger/paths/v1_short-urls_shorten.json | 6 ++++- .../paths/v1_short-urls_{shortCode}.json | 12 ++++++++-- 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 docs/swagger/definitions/ShortUrlVisitsSummary.json diff --git a/docs/swagger/definitions/ShortUrl.json b/docs/swagger/definitions/ShortUrl.json index f09e8d7b..ab66f506 100644 --- a/docs/swagger/definitions/ShortUrl.json +++ b/docs/swagger/definitions/ShortUrl.json @@ -6,6 +6,7 @@ "longUrl", "dateCreated", "visitsCount", + "visitsSummary", "tags", "meta", "domain", @@ -32,8 +33,12 @@ "description": "The date in which the short URL was created in ISO format." }, "visitsCount": { + "deprecated": true, "type": "integer", - "description": "The number of visits that this short URL has received." + "description": "**[DEPRECATED]** Use `visitsSummary.total` instead." + }, + "visitsSummary": { + "$ref": "./ShortUrlVisitsSummary.json" }, "tags": { "type": "array", diff --git a/docs/swagger/definitions/ShortUrlVisitsSummary.json b/docs/swagger/definitions/ShortUrlVisitsSummary.json new file mode 100644 index 00000000..404b7a75 --- /dev/null +++ b/docs/swagger/definitions/ShortUrlVisitsSummary.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "required": ["total", "nonBots", "bots"], + "properties": { + "total": { + "description": "The total amount of visits that this short URL has received.", + "type": "integer" + }, + "nonBots": { + "description": "The amount of visits which were not identified as bots.", + "type": "integer" + }, + "bots": { + "description": "The amount of visits that were identified as potential bots.", + "type": "integer" + } + } +} diff --git a/docs/swagger/paths/v1_short-urls.json b/docs/swagger/paths/v1_short-urls.json index 05c5973a..4773bddf 100644 --- a/docs/swagger/paths/v1_short-urls.json +++ b/docs/swagger/paths/v1_short-urls.json @@ -162,7 +162,11 @@ "shortUrl": "https://doma.in/12C18", "longUrl": "https://store.steampowered.com", "dateCreated": "2016-08-21T20:34:16+02:00", - "visitsCount": 328, + "visitsSummary": { + "total": 328, + "nonBots": 328, + "bots": 0 + }, "tags": [ "games", "tech" @@ -181,7 +185,11 @@ "shortUrl": "https://doma.in/12Kb3", "longUrl": "https://shlink.io", "dateCreated": "2016-05-01T20:34:16+02:00", - "visitsCount": 1029, + "visitsSummary": { + "total": 1029, + "nonBots": 900, + "bots": 129 + }, "tags": [ "shlink" ], @@ -199,7 +207,11 @@ "shortUrl": "https://example.com/123bA", "longUrl": "https://www.google.com", "dateCreated": "2015-10-01T20:34:16+02:00", - "visitsCount": 25, + "visitsSummary": { + "total": 25, + "nonBots": 0, + "bots": 25 + }, "tags": [], "meta": { "validSince": "2017-01-21T00:00:00+02:00", @@ -307,7 +319,11 @@ "shortUrl": "https://doma.in/12C18", "longUrl": "https://store.steampowered.com", "dateCreated": "2016-08-21T20:34:16+02:00", - "visitsCount": 0, + "visitsSummary": { + "total": 0, + "nonBots": 0, + "bots": 0 + }, "tags": [ "games", "tech" diff --git a/docs/swagger/paths/v1_short-urls_shorten.json b/docs/swagger/paths/v1_short-urls_shorten.json index aa26fa1b..254a88f2 100644 --- a/docs/swagger/paths/v1_short-urls_shorten.json +++ b/docs/swagger/paths/v1_short-urls_shorten.json @@ -55,7 +55,11 @@ "shortUrl": "https://doma.in/abc123", "shortCode": "abc123", "dateCreated": "2016-08-21T20:34:16+02:00", - "visitsCount": 0, + "visitsSummary": { + "total": 0, + "nonBots": 0, + "bots": 0 + }, "tags": [ "games", "tech" diff --git a/docs/swagger/paths/v1_short-urls_{shortCode}.json b/docs/swagger/paths/v1_short-urls_{shortCode}.json index 1b001cc9..00577f4f 100644 --- a/docs/swagger/paths/v1_short-urls_{shortCode}.json +++ b/docs/swagger/paths/v1_short-urls_{shortCode}.json @@ -41,7 +41,11 @@ "shortUrl": "https://doma.in/12Kb3", "longUrl": "https://shlink.io", "dateCreated": "2016-05-01T20:34:16+02:00", - "visitsCount": 1029, + "visitsSummary": { + "total": 1029, + "nonBots": 820, + "bots": 209 + }, "tags": [ "shlink" ], @@ -159,7 +163,11 @@ "shortUrl": "https://doma.in/12Kb3", "longUrl": "https://shlink.io", "dateCreated": "2016-05-01T20:34:16+02:00", - "visitsCount": 1029, + "visitsSummary": { + "total": 1029, + "nonBots": 900, + "bots": 129 + }, "tags": [ "shlink" ],