aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md47
-rw-r--r--TODO2
2 files changed, 48 insertions, 1 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e46a9a7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,47 @@
+## Methods
+- GET `/`
+ - Response
+ - 200 Ok
+ - HTML `"This is a POKO server"`
+- GET `/user/<id>`
+ - Response
+ - 200 Ok
+ - JSON `{"name": "NAME", "id": "ID"}`
+ - 404 Not Found
+ - JSON `"Not Found"`
+- GET `/user/by_name/<name>`
+ - Response
+ - 200 Ok
+ - JSON `[{"name": "NAME", "id": "ID"}, ...]`
+ - 400 Not Found
+ - JSON `"Not Found"`
+- GET `/user/all`
+ - Same as GET `/user/by_name/`
+- POST `/user/register`
+ - Request
+ - JSON `{"name":"NAME", "password": "PASSWORD", "id": "ID"}`
+ - ID is optional
+ - Response
+ - 201 Created
+ - 400 Bad Request
+ - JSON `"UID is taken"`
+ - 500 Internal Server Error
+ - JSON `"No available UID left"`
+ - JSON `"UID length is incorrect"`
+ - JSON `"UID String is not valid"`
+- POST `/user`
+ - Request
+ - JSON `{"id": "ID", "password": "PASSWORD", "clientid": "CLIENT_ID"}`
+ - Response
+ - 200 Ok
+ - JSON `"SESSION_KEY"`
+ - The session key is needed for any authenticated action
+ - 401 Unauthorized
+ - JSON `"Could not login"`
+- POST `/user/logout`
+ - Request
+ - JSON `{"id": "ID", "session": "SESSION_KEY"}`
+ - Response
+ - 200 Ok
+ - 401 Unauthorized
+ - JSON `"Not Authenticated"` \ No newline at end of file
diff --git a/TODO b/TODO
index 95a564f..2aea99f 100644
--- a/TODO
+++ b/TODO
@@ -3,4 +3,4 @@ Deleting of users
Transfers
Token Values
Token Stock Prices (Values)
-Docs \ No newline at end of file
+Config \ No newline at end of file