Notes API
API Endpoint
http://localhost:5000Accounts ¶
Create an account ¶
Headers
Content-Type: application/jsonBody
{
- "username": "babar",
- "email": "michel@seed-it.eu",
- "password": "tortue"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "username": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "password": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/jsonBody
{
- "message": "Created"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "message": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/jsonBody
{
- "message": "User already exists"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "message": {
- "type": "string"
- }
- }
-}Register a new userPOST/user
Authenticate user ¶
Authenticate one user to access protected routing.
-Headers
Content-Type: application/jsonBody
{
- "username": "babar",
- "password": "tortue"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "username": {
- "type": "string"
- },
- "password": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/jsonBody
{
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/jsonBody
{
- "description": "Invalid credentials",
- "error": "Bad Request",
- "status_code": 401
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "description": {
- "type": "string"
- },
- "error": {
- "type": "string"
- },
- "status_code": {
- "type": "number"
- }
- }
-}Authenticate a userPOST/user/login
Get User Info ¶
Receive the username and email from the currently logged in user
-Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cHeaders
Content-Type: application/jsonBody
{
- "user": {
- "username": "Jean",
- "email": "abc@def.ghi"
- }
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "user": {
- "type": "object",
- "properties": {
- "username": {
- "type": "string"
- },
- "email": {
- "type": "string"
- }
- }
- }
- }
-}Get User InfoGET/user/me
Notes ¶
Notes ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cHeaders
Content-Type: application/jsonBody
[
- {
- "title": "Kotlin",
- "tags": [
- "Dev",
- "Server"
- ],
- "updatedAt": "2020-01-20T00:00:00"
- },
- {
- "title": "Java",
- "tags": [
- "Dev"
- ],
- "updatedAt": "2018-01-20T00:00:00"
- }
-]Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "array"
-}Get NotesGET/notes
Note ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "tags": [
- "Dev",
- "Server"
- ]
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "tags": {
- "type": "array"
- }
- }
-}Create a NotePOST/notes/{noteTitle}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cHeaders
Content-Type: application/jsonBody
{
- "tags": [
- "Dev",
- "Server"
- ],
- "chapters": [
- {
- "title": "Introduction",
- "content": "..."
- },
- {
- "title": "Objects",
- "content": "..."
- }
- ]
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "tags": {
- "type": "array"
- },
- "chapters": {
- "type": "array"
- }
- }
-}Get NoteGET/notes/{noteTitle}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "title": "NewTitle"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "title": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "tags": [
- "new",
- "tags"
- ]
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "tags": {
- "type": "array"
- }
- }
-}Update a NotePATCH/notes/{noteTitle}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cDelete NoteDELETE/notes/{noteTitle}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-
Chapters ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "title": "Chapter 1",
- "content": "..."
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "title": {
- "type": "string"
- },
- "content": {
- "type": "string"
- }
- }
-}Post a chapterPOST/notes/{noteTitle}/chapters/{chapterNumber}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-- chapterNumber
number(required) Example: KotlinThe chapter number.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "title": "new title"
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "title": {
- "type": "string"
- }
- }
-}Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cBody
{
- "content": "..."
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "content": {
- "type": "string"
- }
- }
-}Patch a chapterPATCH/notes/{noteTitle}/chapters/{chapterNumber}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-- chapterNumber
number(required) Example: KotlinThe chapter number.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cDelete a chapterDELETE/notes/{noteTitle}/chapters/{chapterNumber}
- noteTitle
string(required) Example: KotlinThe title of the Note.
-- chapterNumber
number(required) Example: KotlinThe chapter number.
-
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cHeaders
Content-Type: application/jsonBody
{
- "tags": [
- "Dev",
- "Server"
- ]
-}Schema
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "type": "object",
- "properties": {
- "tags": {
- "type": "array"
- }
- }
-}Generated by aglio on 23 Apr 2020