-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from agconti/docs-users-api
docs(cookiecutter/users): added docs for users viewset
- Loading branch information
Showing
2 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
126 changes: 126 additions & 0 deletions
126
{{cookiecutter.github_repository_name}}/docs/api/users.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Users | ||
Supports registering, viewing, and updating user accounts. | ||
|
||
## Register a new user account | ||
|
||
**Request**: | ||
|
||
`POST` `users/` | ||
|
||
*Note:* | ||
|
||
- *Not* **Authorization Protected** | ||
|
||
|
||
**Response**: | ||
|
||
```json | ||
Content-Type application/json | ||
201 Created | ||
|
||
{ | ||
"id": 1, | ||
"first_name": "Richard", | ||
"last_name": "Hendriks", | ||
"auth_token": "fFBGRNJru1FQd44AzqT3Zg", | ||
"email": "[email protected]" | ||
} | ||
``` | ||
## Get a user's profile information | ||
|
||
**Request**: | ||
|
||
`GET` `users/:id` | ||
|
||
Parameters: | ||
|
||
Name | Type | Description | ||
---|---|--- | ||
id | integer | The id associated with the user object. | ||
|
||
|
||
*Note:* | ||
|
||
- **[Authorization Protected](authentication.md)** | ||
|
||
**Response**: | ||
|
||
```json | ||
Content-Type application/json | ||
200 OK | ||
|
||
{ | ||
"id": 1, | ||
"first_name": "Richard", | ||
"last_name": "Hendriks", | ||
"auth_token": "fFBGRNJru1FQd44AzqT3Zg", | ||
"email": "[email protected]" | ||
} | ||
``` | ||
|
||
## Get a user's profile information | ||
|
||
**Request**: | ||
|
||
`GET` `users/:id` | ||
|
||
Parameters: | ||
|
||
Name | Type | Description | ||
---|---|--- | ||
id | integer | The id associated with the user object. | ||
|
||
|
||
*Note:* | ||
|
||
- **[Authorization Protected](authentication.md)** | ||
|
||
**Response**: | ||
|
||
```json | ||
Content-Type application/json | ||
200 OK | ||
|
||
{ | ||
"id": 1, | ||
"first_name": "Richard", | ||
"last_name": "Hendriks", | ||
"auth_token": "fFBGRNJru1FQd44AzqT3Zg", | ||
"email": "[email protected]" | ||
} | ||
``` | ||
|
||
## Update your profile information | ||
|
||
**Request**: | ||
|
||
`PUT/PATCH` `users/:id` | ||
|
||
Parameters: | ||
|
||
Name | Type | Description | ||
---|---|--- | ||
first_name | string | The new first_name of the user object. | ||
last_name | string | The new last_name of the user object. | ||
email | string | The new email of the user object. | ||
|
||
|
||
*Note:* | ||
|
||
- All parameters are optional | ||
- **[Authorization Protected](authentication.md)** | ||
|
||
**Response**: | ||
|
||
```json | ||
Content-Type application/json | ||
200 OK | ||
|
||
{ | ||
"id": 1, | ||
"first_name": "Richard", | ||
"last_name": "Hendriks", | ||
"auth_token": "fFBGRNJru1FQd44AzqT3Zg", | ||
"email": "[email protected]" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters