From f19d1588b98c04ecd51215a0942520a847756d17 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 5 Sep 2018 22:05:13 +0100 Subject: [PATCH] updated documentation with new endpoints --- endpoints.md | 29 +++++++++++++++++++++++++++++ src/models/api/permaLinkResponse.js | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/endpoints.md b/endpoints.md index e4d59b4..63463c6 100644 --- a/endpoints.md +++ b/endpoints.md @@ -96,3 +96,32 @@ Expected response: "token": yourGeneratedToken } ] + +## POST /unauth/permanote +Request body: + + { + "text": textOfNote + } + +The request will be processed by the server if a text feild is present, then the server will store and generate an endpoint for the permalink. + +Expected response: + + "data": [ + { + "status": "Resource created", + "note": { + "uid": uidAssignedToNote, + "endpoint": "/api/note/generatedEndpoint", + "text": inputedText + } + } + ] + +## GET /note/:endpoint +Request args: + + :endpoint + +If that note exists, the endpoint will simply return the text assigned to that endpoint or a 404 error. diff --git a/src/models/api/permaLinkResponse.js b/src/models/api/permaLinkResponse.js index 034de55..be3ddf2 100644 --- a/src/models/api/permaLinkResponse.js +++ b/src/models/api/permaLinkResponse.js @@ -21,7 +21,7 @@ export class PermaLinkAPI extends API { text: text, createdby: username, id: id - }, + } } ] }