From 7477d98ccb5b3be9f245c359c6d35c8075b3ff40 Mon Sep 17 00:00:00 2001 From: Raphael Cerveaux Date: Thu, 15 Nov 2018 15:37:13 +0100 Subject: [PATCH] Docs --- README.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e785095..d8841ae 100644 --- a/README.md +++ b/README.md @@ -19,22 +19,43 @@ Content-Type:application/x-www-form-urlencoded Accept:application/json ``` +When signed in, you must provide the access token: + +``` +Authorization: Bearer +``` + ## API response The response code will never be in the response. **Make operations** (create, update, delete ...) -```js +Validation error example: + +```json { - success: false, - message: 'Oups!' + "success": false, + "message": "Form is invalid.", + "errors": [ + { + "message": "\"password\" is required", + "path": [ + "password" + ], + "type": "any.required", + "context": { + "key": "password", + "label": "password" + } + } + ] } ``` **Getting objects** (read) -```js +```json { "_id": "5bec2fed257ab94172cd3874", "firstname": "Raphael",