From 36cf666a0c8ea32c702338e2931dc109859269a7 Mon Sep 17 00:00:00 2001 From: nico Date: Sat, 18 Apr 2020 23:47:15 +0200 Subject: Initial release JoplinWebApi Joplin WebAPI to manage Joplin users and the directory structure + add user creation endpoint + add user deletion endpoint + add user password change endpoint + add README and highlight css + add gitignore file + add uwsgi template file --- static/Readme.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 static/Readme.md (limited to 'static/Readme.md') 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//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//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/` + +**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 +``` -- cgit v1.2.3-18-g5258