diff --git a/README.md b/README.md index 5bc1cbb..1ed16b3 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ The resource is called **person** (not user). Endpoints: - `/people.json` — list people in account - `/people/{id}.json` — single person - `/projects/{id}/people.json` — people in a project -- `/my/profile.json` — current authenticated user +- `/my/profile.json` — current authenticated user (GET and PUT) ### To-do specifics diff --git a/sections/people.md b/sections/people.md index 82a116d..fe1f20d 100644 --- a/sections/people.md +++ b/sections/people.md @@ -9,6 +9,7 @@ Endpoints: - [Get pingable people](#get-pingable-people) - [Get person](#get-person) - [Get my personal info](#get-my-personal-info) +- [Update my personal info](#update-my-personal-info) Get all people -------------- @@ -266,3 +267,41 @@ See the [Get person](#get-person) endpoint for an example of the JSON response. ```shell curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/my/profile.json ``` + + +Update my personal info +----------------------- + +* `PUT /my/profile.json` allows updating the current user's personal info. + +**Optional parameters**: + +* `name` - the user's display name. +* `email_address` - the user's email address. +* `title` - the user's job title. +* `bio` - a short bio. +* `location` - the user's location. +* `time_zone_name` - the user's time zone (e.g. `America/Chicago`). +* `first_week_day` - the first day of the week (`0` for Sunday, `1` for Monday). +* `time_format` - time display format. + +This endpoint will return `204 No Content` if the update was a success. Returns `422 Unprocessable Entity` if the update fails (e.g. the email address is already in use). + +###### Example JSON Request + +```json +{ + "name": "Victor Cooper", + "title": "Chief Strategist", + "bio": "Don't let your dreams be dreams", + "location": "Chicago, IL" +} +``` + +###### Copy as cURL + +```shell +curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \ + -d '{"name":"Victor Cooper","title":"Chief Strategist"}' -X PUT \ + https://3.basecampapi.com/$ACCOUNT_ID/my/profile.json +```