-
Notifications
You must be signed in to change notification settings - Fork 0
User routes
This page describes both the /users
and /users/:name
routes.
Requires authorization. Has an ACE.
Send a GET
request to /users/:name
.
Status | Comment |
---|---|
200 OK |
|
404 Not Found |
No such user. |
Request | Response |
---|---|
GET /users/nickname HTTP/1.1 Cookie: ... ... |
HTTP/1.1 200 OK ... |
GET /users/no-such-nickname HTTP/1.1 Cookie: ... ... |
HTTP/1.1 404 Not Found ... |
Requires authorization.
Send a DELETE
request to /users/:name
.
Status | Comment |
---|---|
201 No Content |
User deleted successfully. |
404 Not Found |
Request | Response |
---|---|
DELETE /users/nickname Cookie: ... ... |
HTTP/1.1 201 No Content ... |
DELETE /users/no-such-user HTTP/1.1 Cookie: ... ... |
HTTP/1.1 404 Not Found ... |
Requires authorization. Has an ACE.
Send a PATCH
request to /users/:name
. The body should contain fields to update.
Field name | Admin-only | Comment |
---|---|---|
nickname |
Yes | User nickname. |
groups |
Yes | User groups. |
password |
No | User password (will be hashed and stored). |
Status | Comment |
---|---|
204 No Content |
Successfully updated. |
400 Bad Request |
The provided data is malformed. |
404 Not Found |
|
403 Forbidden |
Tried to update admin-only fields without admin permissions. |
Request | Response |
---|---|
PATCH /users/nickname HTTP/1.1 Cookie: ... ... |
HTTP/1.1 204 No Content ... |
PATCH /users/nickname HTTP/1.1 Cookie: ... ... |
HTTP/1.1 400 Bad Request ... |
PATCH /users/no-such-user HTTP/1.1 Cookie: ... ... |
HTTP/1.1 404 Not Found ... |
Send a GET
request to /users
. The query parameters are:
Name | Type | Comment |
---|---|---|
offset |
integer, optional | Zero-based offset from the beginning of the list. |
groups |
strings | User list is filtered by the provided list of groups. |
Status | Comment |
---|---|
200 OK |
Request | Response |
---|---|
GET /users HTTP/1.1 ... |
HTTP/1.1 200 OK ... |
GET /users?offset=10&groups=group-1&groups=group2 HTTP/1.1 ... |
HTTP/1.1 200 OK ... |
Version | Changes |
---|---|
3.2.0 |
User password can be changed now. |
3.1.0 |
Wrapped the user update code. Views check for JSON validity and user existence. |
3.0.0 |
Added metadata to the result of Users:GET . |