diff --git a/api-doc/users/index.apib b/api-doc/users/index.apib index ee601f8..347fdde 100644 --- a/api-doc/users/index.apib +++ b/api-doc/users/index.apib @@ -45,4 +45,20 @@ Authenticate one user to access protected routing. + Attributes (Token) + Response 401 (application/json) - + Attributes (InvalidCredentials) \ No newline at end of file + + Attributes (InvalidCredentials) + +## Get User Info [/user/me] +Receive the username and email from the currently logged in user + +### Get User Info [GET] + ++ Request (application/json) + + Headers + Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + + ++ Response 200 (application/json) + + Attributes + + user: (object) + + username: Jean (string) + + email: abc@def.ghi \ No newline at end of file diff --git a/public/index.html b/public/index.html index 9e1a7f3..16062d5 100644 --- a/public/index.html +++ b/public/index.html @@ -1,4 +1,4 @@ -Notes API

Notes API

Accounts

Create an account

POST http://localhost:5000/user
Requestsexample 1
Headers
Content-Type: application/json
Body
{
+Notes API

Notes API

Accounts

Create an account

POST http://localhost:5000/user
Requestsexample 1
Headers
Content-Type: application/json
Body
{
   "username": "babar",
   "email": "michel@seed-it.eu",
   "password": "tortue"
@@ -79,7 +79,29 @@
       "type": "number"
     }
   }
-}

Authenticate a user
POST/user/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
[
+}

Authenticate a user
POST/user/login


Get User Info

Receive the username and email from the currently logged in user

+
GET http://localhost:5000/user/me
Requestsexample 1
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Responses200
Headers
Content-Type: application/json
Body
{
+  "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 Info
GET/user/me


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": [
@@ -217,7 +239,7 @@
       "type": "array"
     }
   }
-}

Get all tags
GET/tags


Generated by aglio on 21 Apr 2020