summaryrefslogtreecommitdiffstats
path: root/static/Readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'static/Readme.md')
-rw-r--r--static/Readme.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/static/Readme.md b/static/Readme.md
new file mode 100644
index 0000000..3be39cb
--- /dev/null
+++ b/static/Readme.md
@@ -0,0 +1,85 @@
+# Joplin UserManagement WebApi
+## How To
+The Joplin UserManagement WebApi utilizes [url encoded](https://en.wikipedia.org/wiki/Percent-encoding) parameter to manage the Joplin userbase.
+
+## create new user
+**Definition**
+
+`POST /joplin/<string:username>/create`
+
+**Arguments**
+
+- `"password":string` user password
+- `"invite-code":string` invite code to create an account
+```json
+{
+ "password": "password",
+ "invite-code": "invite"
+}
+```
+
+**Response**
+
+- `201 Created` user creation succeeded
+- `409 Conflict` user creation failed due to a conflict
+- `422 Unprocessable Entity` one or more parameter/s were not given
+- `500 Internal Server Error` user directory creation failure
+
+**Example**
+```bash
+curl --data "password=super_secret&invite-code=nachos" https://domain.tld/joplin/jim/create
+```
+---
+
+## update user password
+**Definition**
+
+`POST /joplin/<string:username>/changepw`
+
+**Arguments**
+
+- `"password": string` current user password
+- `"new_password": string` new user password
+```json
+{
+ "password": "password",
+ "new_password": "new_password"
+}
+```
+
+**Response**
+
+- `200 OK` password change succeeded
+- `401 Unauthorized` the request was not authorized
+- `422 Unprocessable Entity` one or more parameter/s were not given
+
+**Example**
+```bash
+curl --data "password=super_secret&new_password=5up3r_53cr37" https://domain.tld/joplin/jim/changepw
+```
+---
+
+## delete user account
+**Definition**
+
+`DELETE /joplin/<string:username>`
+
+**Arguments**
+
+- `"password": string` users password
+```json
+{
+ "password": "password"
+}
+```
+
+**Response**
+
+- `204 No Content` user deletion succeeded
+- `401 Unauthorized` the request was not authorized
+- `422 Unprocessable Entity` one or more parameter/s were not given
+
+**Example**
+```bash
+curl -X DELETE --data "password=super_secret" https://domain.tld/joplin/jim
+```