Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions sections/people.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Endpoints:
- [Get pingable people](#get-pingable-people)
- [Get person](#get-person)
- [Get my personal info](#get-my-personal-info)
- [Get my preferences](#get-my-preferences)
- [Update my preferences](#update-my-preferences)

Get all people
--------------
Expand Down Expand Up @@ -266,3 +268,61 @@ 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
```


Get my preferences
------------------

* `GET /my/preferences.json` will return the current user's preferences.

###### Example JSON Response
<!-- START GET /my/preferences.json -->
```json
{
"url": "https://3.basecampapi.com/195539477/my/preferences.json",
"app_url": "https://3.basecamp.com/195539477/my/preferences",
"time_zone_name": "America/Chicago",
"first_week_day": "Sunday",
"time_format": "twelve_hour"
}
```
<!-- END GET /my/preferences.json -->
###### Copy as cURL

```shell
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://3.basecampapi.com/$ACCOUNT_ID/my/preferences.json
```


Update my preferences
---------------------

* `PUT /my/preferences.json` will update the current user's preferences.

All parameters are optional. Only include the ones you want to change. These parameters should be sent inside the top-level `person` object in the JSON request body.

* `time_zone_name` - the user's time zone (e.g. `America/Chicago`, `London`, `UTC`). Accepts any valid Rails time zone name.
* `first_week_day` - the first day of the week. Accepts: `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Saturday`.
* `time_format` - the time display format. Accepts: `twelve_hour`, `twenty_four_hour`.

Returns `200 OK` with the updated [preferences](#get-my-preferences) JSON representation.

###### Example JSON Request
<!-- START PUT PAYLOAD /my/preferences.json -->
```json
{
"person": {
"time_zone_name": "London",
"first_week_day": "Monday",
"time_format": "twenty_four_hour"
}
}
```
<!-- END PUT PAYLOAD /my/preferences.json -->
###### Copy as cURL

```shell
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"person":{"time_zone_name":"London","first_week_day":"Monday","time_format":"twenty_four_hour"}}' -X PUT \
https://3.basecampapi.com/$ACCOUNT_ID/my/preferences.json
```