Update docs

This commit is contained in:
Hubert Van De Walle 2020-05-08 15:26:22 +02:00
parent cc02c48ae1
commit f01da05d9d
3 changed files with 73 additions and 37 deletions

View File

@ -9,51 +9,64 @@
## Notes [/notes] ## Notes [/notes]
### Create a Note [POST]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ 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] ### Get Notes [GET]
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Response 200 (application/json) + Response 200 (application/json)
+ Attributes (array) + Attributes (array)
+ (object) + (object)
+ uuid: `123e4567-e89b-12d3-a456-426614174000` (string)
+ title: Kotlin (string) + title: Kotlin (string)
+ tags: Dev, Server (array[string]) + tags: Dev, Server (array[string])
+ updatedAt: `2020-01-20T00:00:00` (string) + updatedAt: `2020-01-20T00:00:00` (string)
+ (object) + (object)
+ uuid: `107c90ae-a41e-4c8e-b5e3-1a269cfe044b` (string)
+ title: Java (string) + title: Java (string)
+ tags: Dev (array[string]) + tags: Dev (array[string])
+ updatedAt: `2018-01-20T00:00:00` (string) + updatedAt: `2018-01-20T00:00:00` (string)
## Note [/notes/{noteTitle}]
## Note [/notes/{noteUuid}]
+ Parameters + 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) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (object)
+ tags: Dev, Server (array[string])
+ Response 201
+ Response 409
### Get Note [GET]
+ Request (application/json)
+ Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
+ Response 200 (application/json) + Response 200 (application/json)
+ Attributes (object) + 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]) + tags: Dev, Server (array[string])
+ chapters (array) + chapters (array)
+ (Chapter) + (Chapter)
@ -66,12 +79,11 @@
+ Response 404 + Response 404
### Update a Note [PATCH] ### Update a Note [PATCH]
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (object) + Attributes (object)
+ title: NewTitle (string) + title: NewTitle (string)
@ -79,7 +91,7 @@
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (object) + Attributes (object)
+ tags: new, tags (array[string]) + tags: new, tags (array[string])
@ -89,11 +101,11 @@
+ Response 404 + Response 404
### Delete Note [DELETE] ### Delete a Note [DELETE]
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Response 200 + Response 200
@ -110,7 +122,7 @@
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (Chapter) + Attributes (Chapter)
+ title: Chapter 1 (string) + title: Chapter 1 (string)
+ content: ... (string) + content: ... (string)
@ -123,14 +135,14 @@
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (object) + Attributes (object)
+ title: new title (string) + title: new title (string)
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Attributes (object) + Attributes (object)
+ content: ... (string) + content: ... (string)
@ -144,7 +156,7 @@
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Response 200 + Response 200

View File

@ -6,7 +6,7 @@
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Response 200 (application/json) + Response 200 (application/json)

View File

@ -4,8 +4,6 @@
+ username: babar (string) + username: babar (string)
+ password: tortue (string) + password: tortue (string)
## Token (object)
+ token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c (string)
## InvalidCredentials (object) ## InvalidCredentials (object)
+ description: Invalid credentials (string), + description: Invalid credentials (string),
@ -14,7 +12,7 @@
# Group Accounts # Group Accounts
## Create an account [/user] ## Account [/user]
### Register a new user [POST] ### Register a new user [POST]
@ -32,8 +30,16 @@
+ Attributes (object) + Attributes (object)
+ message: User already exists (string) + message: User already exists (string)
### Delete a user [DELETE]
## Authenticate user [/user/login] + Request
+ Headers
Authorization: Bearer <token>
+ Response 200 (application/json)
## Authentication [/user/login]
Authenticate one user to access protected routing. Authenticate one user to access protected routing.
### Authenticate a user [POST] ### Authenticate a user [POST]
@ -42,23 +48,41 @@ Authenticate one user to access protected routing.
+ Attributes (Login) + Attributes (Login)
+ Response 200 (application/json) + Response 200 (application/json)
+ Attributes (Token) + Attributes
+ token: <token>
+ refreshToken: `<refresh-token>`
+ Response 401 (application/json) + Response 401 (application/json)
+ Attributes (InvalidCredentials) + Attributes (InvalidCredentials)
## Get User Info [/user/me] ## Token refresh [/user/refresh_token]
### Refresh JWT token [POST]
+ Request (application/json)
+ Attributes
+ refreshToken: `<refresh-token>`
+ Response 200 (application/json)
+ Attributes
+ token: <token>
+ refreshToken: `<refresh-token>`
+ Response 401 (application/json)
+ Attributes (InvalidCredentials)
## User Info [/user/me]
Receive the username and email from the currently logged in user Receive the username and email from the currently logged in user
### Get User Info [GET] ### Get User Info [GET]
+ Request (application/json) + Request (application/json)
+ Headers + Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c Authorization: Bearer <token>
+ Response 200 (application/json) + Response 200 (application/json)
+ Attributes + Attributes
+ user: (object) + user: (object)
+ username: Jean (string) + username: babar (string)
+ email: abc@def.ghi + email: `michel@seed-it.eu` (string)