diff --git a/README.md b/README.md index c603303..75aea6a 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 a142c13..63de5e6 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 my preferences](#get-my-preferences) - [Update my preferences](#update-my-preferences) @@ -272,6 +273,43 @@ curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCO ``` +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 +``` + + Get my preferences ------------------ @@ -321,6 +359,7 @@ Returns `200 OK` with the updated [preferences](#get-my-preferences) JSON repres } ``` + ###### Copy as cURL ```shell @@ -329,4 +368,4 @@ curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/j https://3.basecampapi.com/$ACCOUNT_ID/my/preferences.json ``` -[3]: https://github.com/basecamp/bc3-api/blob/master/sections/out_of_office.md#out-of-office +[3]: https://github.com/basecamp/bc3-api/blob/master/sections/out_of_office.md#out-of-office \ No newline at end of file