From ad4377e9f2cd0154408a7d1533d2f2c278859e96 Mon Sep 17 00:00:00 2001 From: agconti Date: Wed, 16 Sep 2015 20:55:16 -0400 Subject: [PATCH] docs(cookiecutter/users): added docs for users viewset --- .../docs/api/users.md | 126 ++++++++++++++++++ .../mkdocs.yml | 3 +- 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 {{cookiecutter.github_repository_name}}/docs/api/users.md diff --git a/{{cookiecutter.github_repository_name}}/docs/api/users.md b/{{cookiecutter.github_repository_name}}/docs/api/users.md new file mode 100644 index 000000000..b2cb88167 --- /dev/null +++ b/{{cookiecutter.github_repository_name}}/docs/api/users.md @@ -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": "hendriks@piepiper.com" +} +``` +## 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": "hendriks@piepiper.com" +} +``` + +## 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": "hendriks@piepiper.com" +} +``` + +## 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": "hendriks@piepiper.com" +} +``` diff --git a/{{cookiecutter.github_repository_name}}/mkdocs.yml b/{{cookiecutter.github_repository_name}}/mkdocs.yml index e437df189..106b40564 100644 --- a/{{cookiecutter.github_repository_name}}/mkdocs.yml +++ b/{{cookiecutter.github_repository_name}}/mkdocs.yml @@ -7,4 +7,5 @@ copyright: Copyright © 2015,