Notes API
API Endpoint
http://localhost:5000Accounts ¶
Create an account ¶
POST http://localhost:5000/user
Requests
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"
}
}
}Responses
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.
POST http://localhost:5000/user/login
Requests
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"
}
}
}Responses
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
GET http://localhost:5000/user/me
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
Headers
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 ¶
GET http://localhost:5000/notes
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
Headers
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 ¶
POST http://localhost:5000/notes/Kotlin
Requests
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"
}
}
}Responses
This response has no content.
This response has no content.
Create a NotePOST/notes/{noteTitle}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
GET http://localhost:5000/notes/Kotlin
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
Headers
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"
}
}
}This response has no content.
Get NoteGET/notes/{noteTitle}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
PATCH http://localhost:5000/notes/Kotlin
Requests
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"
}
}
}Responses
This response has no content.
This response has no content.
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"
}
}
}Responses
This response has no content.
This response has no content.
Update a NotePATCH/notes/{noteTitle}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
DELETE http://localhost:5000/notes/Kotlin
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
This response has no content.
This response has no content.
Delete NoteDELETE/notes/{noteTitle}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
Chapters ¶
POST http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requests
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"
}
}
}Responses
This response has no content.
This response has no content.
Post a chapterPOST/notes/{noteTitle}/chapters/{chapterNumber}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
- chapterNumber
number(required) Example: KotlinThe chapter number.
PATCH http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requests
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"
}
}
}Responses
This response has no content.
This response has no content.
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"
}
}
}Responses
This response has no content.
This response has no content.
Patch a chapterPATCH/notes/{noteTitle}/chapters/{chapterNumber}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
- chapterNumber
number(required) Example: KotlinThe chapter number.
DELETE http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
This response has no content.
This response has no content.
Delete a chapterDELETE/notes/{noteTitle}/chapters/{chapterNumber}
URI Parameters
- noteTitle
string(required) Example: KotlinThe title of the Note.
- chapterNumber
number(required) Example: KotlinThe chapter number.
GET http://localhost:5000/tags
Requests
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cResponses
Headers
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