-
Notifications
You must be signed in to change notification settings - Fork 6
Users API
Drew Winstel edited this page Jun 9, 2019
·
1 revision
Supports registering, viewing, and updating user accounts.
Request:
POST
/users/
Parameters:
Name | Type | Required | Description |
---|---|---|---|
username | string | Yes | The username for the new user. |
password | string | Yes | The password for the new user account. |
first_name | string | No | The user's given name. |
last_name | string | No | The user's family name. |
string | No | The user's email address. |
Note:
- Only admins can create users via the API for now.
Response:
Content-Type application/json
201 Created
{
"id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
"username": "richard",
"first_name": "Richard",
"last_name": "Hendriks",
"email": "[email protected]",
"auth_token": "132cf952e0165a274bf99e115ab483671b3d9ff6"
}
The auth_token
returned with this response should be stored by the client for
authenticating future requests to the API. See Authentication.
Request:
GET
/users/:id
Parameters:
Note:
- Protected by auth
Response:
Content-Type application/json
200 OK
{
"id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
"username": "richard",
"first_name": "Richard",
"last_name": "Hendriks",
"email": "[email protected]",
}
Request:
PUT/PATCH
/users/:id
Parameters:
Name | Type | Description |
---|---|---|
first_name | string | The first_name of the user object. |
last_name | string | The last_name of the user object. |
string | The user's email address. |
Note:
- All parameters are optional
- Authorization Protected
Response:
Content-Type application/json
200 OK
{
"id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
"username": "richard",
"first_name": "Richard",
"last_name": "Hendriks",
"email": "[email protected]",
}