2020-05-08 15:26:22 +02:00

164 lines
3.6 KiB
Plaintext

# Data Structures
## Chapter (object)
+ title: Chapter 1 (string)
+ content: ... (string)
# Group 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]
+ Request (application/json)
+ Headers
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/{noteUuid}]
+ Parameters
+ noteUuid: `123e4567-e89b-12d3-a456-426614174000` (string) - The note UUID.
### Get a Note [GET]
+ Request (application/json)
+ Headers
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)
+ title: Introduction
+ content: ...
+ (Chapter)
+ title: Objects
+ content: ...
+ Response 404
### Update a Note [PATCH]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Attributes (object)
+ title: NewTitle (string)
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Attributes (object)
+ tags: new, tags (array[string])
+ Response 200
+ Response 404
### Delete a Note [DELETE]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Response 200
+ Response 404
## Chapters [/notes/{noteTitle}/chapters/{chapterNumber}]
+ Parameters
+ noteTitle: `Kotlin` (string) - The title of the Note.
+ chapterNumber: `Kotlin` (number) - The chapter number.
### Post a chapter [POST]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Attributes (Chapter)
+ title: Chapter 1 (string)
+ content: ... (string)
+ Response 201
+ Response 404
### Patch a chapter [PATCH]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Attributes (object)
+ title: new title (string)
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Attributes (object)
+ content: ... (string)
+ Response 200
+ Response 404
### Delete a chapter [DELETE]
+ Request (application/json)
+ Headers
Authorization: Bearer <token>
+ Response 200
+ Response 404