From e4e02aba8487e6af086f2c431aba7906d64267a9 Mon Sep 17 00:00:00 2001 From: Patryk Dolata Date: Thu, 17 Dec 2020 17:10:46 +0100 Subject: [PATCH] --- REST-API.md | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/REST-API.md b/REST-API.md index 1ad2705..06b7713 100644 --- a/REST-API.md +++ b/REST-API.md @@ -114,12 +114,6 @@ Endpoint using to retrieve logged user profile * **uri**: `/api/profile` - -* **request body**: - - { - "name": "project_1" - } * **success response example**: @@ -173,10 +167,10 @@ Endpoint using to create new user's project * **success response example**: - `status_code: 200` + `status_code: 201` { - "id": "82325af3-86d2-4b1c-852d-98d6e276e450", + "id": "some_id", "name": "project_1", "created_at": "2020-12-17T16:07:42.050666Z", "updated_at": "2020-12-17T16:07:42.050707Z" @@ -188,3 +182,39 @@ Endpoint using to create new user's project { "detail": "Authentication credentials were not provided." } + +## GET /api/projects +Endpoint using to retrieve all user's projects + +* **requires authentication**: + + `True` +* **uri**: + + `/api/projects` + +* **success response example**: + + `status_code: 200` + + [ + { + "id": "id_1", + "name": "project_1", + "created_at": "2020-12-15T15:32:33.901299Z", + "updated_at": "2020-12-15T15:32:33.901370Z" + }, + { + "id": "id_2", + "name": "project_2", + "created_at": "2020-12-17T16:07:42.050666Z", + "updated_at": "2020-12-17T16:07:42.050707Z" + } + ] +* **error response examples**: + + `status_code: 401` + + { + "detail": "Authentication credentials were not provided." + } \ No newline at end of file