blob: 3be39cb86124a298ccb957c80e015826a5b6ca8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
```
|