Update docs
This commit is contained in:
parent
cc02c48ae1
commit
f01da05d9d
@ -9,51 +9,64 @@
|
||||
|
||||
## 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]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
+ 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 <token>
|
||||
|
||||
+ 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 <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: NewTitle (string)
|
||||
@ -79,7 +91,7 @@
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ 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 <token>
|
||||
|
||||
+ Response 200
|
||||
|
||||
@ -110,7 +122,7 @@
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
+ Attributes (Chapter)
|
||||
+ title: Chapter 1 (string)
|
||||
+ content: ... (string)
|
||||
@ -123,14 +135,14 @@
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: new title (string)
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ content: ... (string)
|
||||
@ -144,7 +156,7 @@
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Response 200
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -32,8 +30,16 @@
|
||||
+ Attributes (object)
|
||||
+ 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 a user [POST]
|
||||
@ -42,23 +48,41 @@ Authenticate one user to access protected routing.
|
||||
+ Attributes (Login)
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (Token)
|
||||
+ Attributes
|
||||
+ token: <token>
|
||||
+ refreshToken: `<refresh-token>`
|
||||
|
||||
+ Response 401 (application/json)
|
||||
+ 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
|
||||
|
||||
### Get User Info [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ user: (object)
|
||||
+ username: Jean (string)
|
||||
+ email: abc@def.ghi
|
||||
+ username: babar (string)
|
||||
+ email: `michel@seed-it.eu` (string)
|
||||
Loading…
x
Reference in New Issue
Block a user