Api doc draft
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
FORMAT: 1A
|
||||
HOST: http://localhost:5000
|
||||
|
||||
# Notes API
|
||||
|
||||
<!-- include(./users/index.apib) -->
|
||||
<!-- include(./notes/index.apib) -->
|
||||
<!-- include(./tags/index.apib) -->
|
||||
@@ -0,0 +1,110 @@
|
||||
# Data Structures
|
||||
|
||||
## Chapter (object)
|
||||
+ title: Chapter 1 (string)
|
||||
+ content: ... (string)
|
||||
|
||||
|
||||
# Group Notes
|
||||
|
||||
## Notes [/notes]
|
||||
|
||||
### Create a Note [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: Kotlin (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
|
||||
+ Response 200
|
||||
|
||||
### Get Notes [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (array)
|
||||
+ (object)
|
||||
+ title: Kotlin (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ updatedAt: `2020-01-20T00:00:00` (string)
|
||||
+ (object)
|
||||
+ title: Java (string)
|
||||
+ tags: Dev (array[string])
|
||||
+ updatedAt: `2018-01-20T00:00:00` (string)
|
||||
|
||||
|
||||
## Note [/notes/{noteTitle}]
|
||||
|
||||
+ Parameters
|
||||
+ noteTitle: `Kotlin` (string) - The title of the Note.
|
||||
|
||||
### Get Note [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (object)
|
||||
+ title: Kotlin (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ chapters (array)
|
||||
+ (Chapter)
|
||||
+ title: Introduction
|
||||
+ content: ...
|
||||
+ (Chapter)
|
||||
+ title: Objects
|
||||
+ content: ...
|
||||
|
||||
+ Response 404
|
||||
|
||||
### Delete Note [DELETE]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Response 204
|
||||
|
||||
+ Response 404
|
||||
|
||||
### Update a Note [PATCH]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: NewTitle (string)
|
||||
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Attributes (object)
|
||||
+ tags: new, tags (array[string])
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
+ Attributes (object)
|
||||
+ chapters (array)
|
||||
+ (Chapter)
|
||||
+ title: Introduction
|
||||
+ content: ...
|
||||
+ (Chapter)
|
||||
+ title: Objects
|
||||
+ content: ...
|
||||
|
||||
+ Response 200
|
||||
|
||||
+ Response 404
|
||||
@@ -0,0 +1,14 @@
|
||||
# Group Tags
|
||||
|
||||
## Tags [/tags]
|
||||
|
||||
### Get all tags [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ tags: Dev, Server (array[string])
|
||||
@@ -0,0 +1,48 @@
|
||||
# Data Structures
|
||||
|
||||
## Login (object)
|
||||
+ username: babar (string)
|
||||
+ password: tortue (string)
|
||||
|
||||
## Token (object)
|
||||
+ token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c (string)
|
||||
|
||||
## InvalidCredentials (object)
|
||||
+ description: Invalid credentials (string),
|
||||
+ error: Bad Request (string),
|
||||
+ status_code: 401 (number)
|
||||
|
||||
# Group Accounts
|
||||
|
||||
## Create an account [/register]
|
||||
|
||||
### Register a new user [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Attributes (object)
|
||||
+ username: babar (string)
|
||||
+ email: michel@seed-it.eu (string)
|
||||
+ password: tortue (string)
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (object)
|
||||
+ message: Created (string)
|
||||
|
||||
+ Response 409 (application/json)
|
||||
+ Attributes (object)
|
||||
+ message: User already exists (string)
|
||||
|
||||
|
||||
## Authenticate user [/login]
|
||||
Authenticate one user to access protected routes.
|
||||
|
||||
### Authenticate a user [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Attributes (Login)
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (Token)
|
||||
|
||||
+ Response 401 (application/json)
|
||||
+ Attributes (InvalidCredentials)
|
||||
Reference in New Issue
Block a user