diff --git a/docs/swagger/paths/{shortCode}_preview.json b/docs/swagger/paths/{shortCode}_preview.json new file mode 100644 index 00000000..a35dcf62 --- /dev/null +++ b/docs/swagger/paths/{shortCode}_preview.json @@ -0,0 +1,44 @@ +{ + "get": { + "operationId": "shortUrlPreview", + "tags": [ + "URL Shortener" + ], + "summary": "Short URL preview image", + "description": "Returns the preview of the page behind a short URL", + "parameters": [ + { + "name": "shortCode", + "in": "path", + "description": "The short code to resolve.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Image in PNG format", + "content": { + "image/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "Unexpected error.", + "content": { + "application/json": { + "schema": { + "$ref": "../definitions/Error.json" + } + } + } + } + } + } +} diff --git a/docs/swagger/paths/{shortCode}_qr-code.json b/docs/swagger/paths/{shortCode}_qr-code.json new file mode 100644 index 00000000..14a8fddc --- /dev/null +++ b/docs/swagger/paths/{shortCode}_qr-code.json @@ -0,0 +1,56 @@ +{ + "get": { + "operationId": "shortUrlQrCode", + "tags": [ + "URL Shortener" + ], + "summary": "Short URL QR code", + "description": "Generates a QR code image pointing to a short URL", + "parameters": [ + { + "name": "shortCode", + "in": "path", + "description": "The short code to resolve.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "path", + "description": "The size of the image to be returned.", + "required": false, + "schema": { + "type": "integer", + "minimum": 50, + "maximum": 1000, + "default": 300 + } + } + ], + "responses": { + "200": { + "description": "QR code in PNG format", + "content": { + "image/png": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "Unexpected error.", + "content": { + "application/json": { + "schema": { + "$ref": "../definitions/Error.json" + } + } + } + } + } + } +} diff --git a/docs/swagger/paths/{shortCode}_track.json b/docs/swagger/paths/{shortCode}_track.json new file mode 100644 index 00000000..b4b62bba --- /dev/null +++ b/docs/swagger/paths/{shortCode}_track.json @@ -0,0 +1,44 @@ +{ + "get": { + "operationId": "trackShortUrl", + "tags": [ + "URL Shortener" + ], + "summary": "Short URL tracking pixel", + "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" + } + } + ], + "responses": { + "200": { + "description": "Image in GIF format", + "content": { + "image/gif": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "500": { + "description": "Unexpected error.", + "content": { + "application/json": { + "schema": { + "$ref": "../definitions/Error.json" + } + } + } + } + } + } +} diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index 6300fddf..0ba8231d 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -91,6 +91,15 @@ "/{shortCode}": { "$ref": "paths/{shortCode}.json" }, + "/{shortCode}/track": { + "$ref": "paths/{shortCode}_track.json" + }, + "/{shortCode}/qr-code": { + "$ref": "paths/{shortCode}_qr-code.json" + }, + "/{shortCode}/preview": { + "$ref": "paths/{shortCode}_preview.json" + }, "/rest/v1/authenticate": { "$ref": "paths/v1_authenticate.json"