Skip to content

Commit

Permalink
Merge pull request #97 from agconti/docs-users-api
Browse files Browse the repository at this point in the history
docs(cookiecutter/users): added docs for users viewset
  • Loading branch information
agconti committed Sep 17, 2015
2 parents dc2fe57 + ad4377e commit a536780
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 1 deletion.
126 changes: 126 additions & 0 deletions {{cookiecutter.github_repository_name}}/docs/api/users.md
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]"
}
```
3 changes: 2 additions & 1 deletion {{cookiecutter.github_repository_name}}/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ copyright: Copyright &copy; 2015, <a href="https://github.com/{{cookiecutter.git
pages:
- Home: 'index.md'
- API:
- Authentication: 'api/authentication.md'
- Authentication: 'api/authentication.md'
- Users: 'api/users.md'

0 comments on commit a536780

Please sign in to comment.