From 1711dd835ecf620c7a6979fdf70be42095f1dc9c Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Sun, 19 Apr 2020 20:28:43 +0200 Subject: [PATCH] Update docs layout --- Makefile | 2 +- docs/index.html | 50 ++++++++++++++++++++++++------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index c92d891..a76e521 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ api_doc_output=docs/index.html api_blueprint_src=api-doc/api.apib -aglio_template=default +aglio_template=triple aglio_theme=cyborg # API doc diff --git a/docs/index.html b/docs/index.html index 77ea8f1..295d5b7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -Notes API Back to top

Notes API

Accounts

Create an account

Register a new user
POST/register

Example URI

POST http://localhost:5000/register
Request
HideShow
Headers
Content-Type: application/json
Body
{
+Notes API

Notes API

Accounts

Create an account

POST http://localhost:5000/register
Requestsexample 1
Headers
Content-Type: application/json
Body
{
   "username": "babar",
   "email": "michel@seed-it.eu",
   "password": "tortue"
@@ -16,7 +16,7 @@
       "type": "string"
     }
   }
-}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+}
Responses200409
Headers
Content-Type: application/json
Body
{
   "message": "Created"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -26,7 +26,7 @@
       "type": "string"
     }
   }
-}
Response  409
HideShow
Headers
Content-Type: application/json
Body
{
+}
Headers
Content-Type: application/json
Body
{
   "message": "User already exists"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -36,8 +36,8 @@
       "type": "string"
     }
   }
-}

Authenticate user

Authenticate one user to access protected routes.

-

Authenticate a user
POST/login

Example URI

POST http://localhost:5000/login
Request
HideShow
Headers
Content-Type: application/json
Body
{
+}

Register a new user
POST/register


Authenticate user

Authenticate one user to access protected routes.

+
POST http://localhost:5000/login
Requestsexample 1
Headers
Content-Type: application/json
Body
{
   "username": "babar",
   "password": "tortue"
 }
Schema
{
@@ -51,7 +51,7 @@
       "type": "string"
     }
   }
-}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+}
Responses200401
Headers
Content-Type: application/json
Body
{
   "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -61,7 +61,7 @@
       "type": "string"
     }
   }
-}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
+}
Headers
Content-Type: application/json
Body
{
   "description": "Invalid credentials",
   "error": "Bad Request",
   "status_code": 401
@@ -79,7 +79,7 @@
       "type": "number"
     }
   }
-}

Notes

Notes

Get Notes
GET/notes

Example URI

GET http://localhost:5000/notes
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
+}

Authenticate a user
POST/login


Notes

Notes

GET http://localhost:5000/notes
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
[
   {
     "title": "Kotlin",
     "tags": [
@@ -98,8 +98,7 @@
 ]
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "type": "array"
-}

Note

Create a Note
POST/notes/{noteTitle}

Example URI

POST http://localhost:5000/notes/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+}

Get Notes
GET/notes


Note

POST http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "tags": [
     "Dev",
     "Server"
@@ -112,8 +111,8 @@
       "type": "array"
     }
   }
-}
Response  201
Response  409

Get Note
GET/notes/{noteTitle}

Example URI

GET http://localhost:5000/notes/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+}
Responses201409
This response has no content.
This response has no content.

Create a Note
POST/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

GET http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
Headers
Content-Type: application/json
Body
{
   "title": "Kotlin",
   "tags": [
     "Dev",
@@ -143,8 +142,8 @@
       "type": "array"
     }
   }
-}
Response  404

Update a Note
PATCH/notes/{noteTitle}

Example URI

PATCH http://localhost:5000/notes/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+}
This response has no content.

Get Note
GET/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

PATCH http://localhost:5000/notes/Kotlin
Requestsexample 1example 2
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "title": "NewTitle"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -154,7 +153,7 @@
       "type": "string"
     }
   }
-}
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+}
Responses200404
This response has no content.
This response has no content.
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "tags": [
     "new",
     "tags"
@@ -167,10 +166,9 @@
       "type": "array"
     }
   }
-}
Response  200
Response  404

Delete Note
DELETE/notes/{noteTitle}

Example URI

DELETE http://localhost:5000/notes/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Response  200
Response  404

Chapters

Post a chapter
POST/notes/{noteTitle}/chapters/{chapterNumber}

Example URI

POST http://localhost:5000/notes/Kotlin/chapters/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

-
chapterNumber
number (required) Example: Kotlin

The chapter number.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+}
Responses200404
This response has no content.
This response has no content.

Update a Note
PATCH/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

DELETE http://localhost:5000/notes/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
This response has no content.
This response has no content.

Delete Note
DELETE/notes/{noteTitle}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+

Chapters

POST http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "title": "Chapter 1",
   "content": "..."
 }
Schema
{
@@ -184,9 +182,9 @@
       "type": "string"
     }
   }
-}
Response  201
Response  404

Patch a chapter
PATCH/notes/{noteTitle}/chapters/{chapterNumber}

Example URI

PATCH http://localhost:5000/notes/Kotlin/chapters/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+}
Responses201404
This response has no content.
This response has no content.

Post a chapter
POST/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

chapterNumber
number (required) Example: Kotlin

The chapter number.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+

PATCH http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1example 2
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "title": "new title"
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -196,7 +194,7 @@
       "type": "string"
     }
   }
-}
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
+}
Responses200404
This response has no content.
This response has no content.
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Body
{
   "content": "..."
 }
Schema
{
   "$schema": "http://json-schema.org/draft-04/schema#",
@@ -206,9 +204,11 @@
       "type": "string"
     }
   }
-}
Response  200
Response  404

Delete a chapter
DELETE/notes/{noteTitle}/chapters/{chapterNumber}

Example URI

DELETE http://localhost:5000/notes/Kotlin/chapters/Kotlin
URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+}
Responses200404
This response has no content.
This response has no content.

Patch a chapter
PATCH/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

chapterNumber
number (required) Example: Kotlin

The chapter number.

-
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Response  200
Response  404

Tags

Tags

Get all tags
GET/tags

Example URI

GET http://localhost:5000/tags
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
+

DELETE http://localhost:5000/notes/Kotlin/chapters/Kotlin
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200404
This response has no content.
This response has no content.

Delete a chapter
DELETE/notes/{noteTitle}/chapters/{chapterNumber}

URI Parameters
HideShow
noteTitle
string (required) Example: Kotlin

The title of the Note.

+
chapterNumber
number (required) Example: Kotlin

The chapter number.

+

Tags

Tags

GET http://localhost:5000/tags
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
{
   "tags": [
     "Dev",
     "Server"
@@ -221,7 +221,7 @@
       "type": "array"
     }
   }
-}

Generated by aglio on 19 Apr 2020