From f01da05d9d4b6cbd9597175389e7a5f25d5333ae Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Fri, 8 May 2020 15:26:22 +0200 Subject: [PATCH] Update docs --- api-doc/notes/index.apib | 66 ++++++++++++++++++++++++---------------- api-doc/tags/index.apib | 2 +- api-doc/users/index.apib | 42 +++++++++++++++++++------ 3 files changed, 73 insertions(+), 37 deletions(-) diff --git a/api-doc/notes/index.apib b/api-doc/notes/index.apib index 2ca1111..fb19001 100644 --- a/api-doc/notes/index.apib +++ b/api-doc/notes/index.apib @@ -9,51 +9,64 @@ ## Notes [/notes] +### Create a Note [POST] + ++ Request (application/json) + + Headers + Authorization: Bearer + + + Attributes (object) + + title: `This is a title` (string) + + tags: Dev, Server (array[string]) + + chapters (array) + + (object) + + title: `Chapter 1` (string) + + content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.` (string) + ++ Response 201 (application/json) + + Attributes (object) + + uuid: `107c90ae-a41e-4c8e-b5e3-1a269cfe044b` (string) + ### Get Notes [GET] + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 (application/json) + Attributes (array) + (object) + + uuid: `123e4567-e89b-12d3-a456-426614174000` (string) + title: Kotlin (string) + tags: Dev, Server (array[string]) + updatedAt: `2020-01-20T00:00:00` (string) + (object) + + uuid: `107c90ae-a41e-4c8e-b5e3-1a269cfe044b` (string) + title: Java (string) + tags: Dev (array[string]) + updatedAt: `2018-01-20T00:00:00` (string) -## Note [/notes/{noteTitle}] + + +## Note [/notes/{noteUuid}] + Parameters - + noteTitle: `Kotlin` (string) - The title of the Note. + + noteUuid: `123e4567-e89b-12d3-a456-426614174000` (string) - The note UUID. -### Create a Note [POST] + +### Get a Note [GET] + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c - - + Attributes (object) - + tags: Dev, Server (array[string]) - -+ Response 201 - -+ Response 409 - -### Get Note [GET] - -+ Request (application/json) - + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 (application/json) + Attributes (object) + + uuid: `123e4567-e89b-12d3-a456-426614174000` (string) + + title: `This is a title` (string) + + updatedAt: `2020-05-08T11:56:01` (string) + tags: Dev, Server (array[string]) + chapters (array) + (Chapter) @@ -66,12 +79,11 @@ + Response 404 - ### Update a Note [PATCH] + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Attributes (object) + title: NewTitle (string) @@ -79,7 +91,7 @@ + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Attributes (object) + tags: new, tags (array[string]) @@ -89,11 +101,11 @@ + Response 404 -### Delete Note [DELETE] +### Delete a Note [DELETE] + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 @@ -110,7 +122,7 @@ + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Attributes (Chapter) + title: Chapter 1 (string) + content: ... (string) @@ -123,14 +135,14 @@ + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Attributes (object) + title: new title (string) + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Attributes (object) + content: ... (string) @@ -144,7 +156,7 @@ + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 diff --git a/api-doc/tags/index.apib b/api-doc/tags/index.apib index f8e74fe..c77bf69 100644 --- a/api-doc/tags/index.apib +++ b/api-doc/tags/index.apib @@ -6,7 +6,7 @@ + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 (application/json) diff --git a/api-doc/users/index.apib b/api-doc/users/index.apib index 347fdde..7e6941f 100644 --- a/api-doc/users/index.apib +++ b/api-doc/users/index.apib @@ -4,8 +4,6 @@ + username: babar (string) + password: tortue (string) -## Token (object) -+ token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c (string) ## InvalidCredentials (object) + description: Invalid credentials (string), @@ -14,7 +12,7 @@ # Group Accounts -## Create an account [/user] +## Account [/user] ### Register a new user [POST] @@ -31,9 +29,17 @@ + Response 409 (application/json) + Attributes (object) + message: User already exists (string) + +### Delete a user [DELETE] + ++ Request + + Headers + Authorization: Bearer + ++ Response 200 (application/json) -## Authenticate user [/user/login] +## Authentication [/user/login] Authenticate one user to access protected routing. ### Authenticate a user [POST] @@ -42,23 +48,41 @@ Authenticate one user to access protected routing. + Attributes (Login) + Response 200 (application/json) - + Attributes (Token) + + Attributes + + token: + + refreshToken: `` + ++ Response 401 (application/json) + + Attributes (InvalidCredentials) + +## Token refresh [/user/refresh_token] + +### Refresh JWT token [POST] + ++ Request (application/json) + + Attributes + + refreshToken: `` + ++ Response 200 (application/json) + + Attributes + + token: + + refreshToken: `` + Response 401 (application/json) + Attributes (InvalidCredentials) -## Get User Info [/user/me] +## User Info [/user/me] Receive the username and email from the currently logged in user ### Get User Info [GET] + Request (application/json) + Headers - Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + Authorization: Bearer + Response 200 (application/json) + Attributes + user: (object) - + username: Jean (string) - + email: abc@def.ghi \ No newline at end of file + + username: babar (string) + + email: `michel@seed-it.eu` (string) \ No newline at end of file