Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ API endpoints
- [Message Boards](https://github.com/basecamp/bc3-api/blob/master/sections/message_boards.md#message-boards)
- [Message Types](https://github.com/basecamp/bc3-api/blob/master/sections/message_types.md#message-types)
- [Messages](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#messages)
- [Notification settings](https://github.com/basecamp/bc3-api/blob/master/sections/notification_settings.md#notification-settings)
- [People](https://github.com/basecamp/bc3-api/blob/master/sections/people.md#people)
- [Projects](https://github.com/basecamp/bc3-api/blob/master/sections/projects.md#projects)
- [Question answers](https://github.com/basecamp/bc3-api/blob/master/sections/question_answers.md#question-answers)
Expand Down
141 changes: 141 additions & 0 deletions sections/notification_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
Notification settings
=====================

Endpoints for reading and updating the current user's notification preferences, including delivery platform, granularity, schedule, reminders, and snoozing.

Endpoints:

- [Get notification settings](#get-notification-settings)
- [Update notification settings](#update-notification-settings)
- [Snooze notifications](#snooze-notifications)


Get notification settings
-------------------------

* `GET /my/notifications/settings.json` will return the current user's notification settings.

###### Example JSON Response
<!-- START GET /my/notifications/settings.json -->
```json
{
"platform": "web_and_email",
"granularity": "everything",
"show_badge_counts": true,
"schedule_enabled": false,
"schedule": null,
"bundle_enabled": true,
"schedule_entries_reminders": true,
"due_assignments_reminders": true,
"state": "on"
}
```
<!-- END GET /my/notifications/settings.json -->

When `schedule_enabled` is `true`, the `schedule` object is included:

```json
{
"schedule_enabled": true,
"schedule": {
"start_hour": 9,
"end_hour": 17,
"work_days": [1, 2, 3, 4, 5]
}
}
```

###### Copy as cURL

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


Update notification settings
----------------------------

* `PUT /my/notifications/settings.json` will update the current user's notification settings. Only the provided parameters are changed; omitted parameters remain unchanged. Returns `204 No Content` on success.

_Optional parameters_:

* `platform` - delivery platform. Valid options: `web`, `email`, `web_and_email`.
* `granularity` - notification granularity. Valid options: `everything`, `pings_and_mentions`.
* `show_badge_counts` - whether to show badge counts. `true` or `false`.
* `schedule_enabled` - whether the notification schedule is active. `true` or `false`. When `true`, also provide `schedule`.
* `schedule` - an object with `start_hour` (integer 0–23), `end_hour` (integer 0–23), and `work_days` (array of integers, 0=Sunday through 6=Saturday).
* `bundle_enabled` - whether notification bundling is enabled. `true` or `false`.
* `reminders` - an array of reminder types to enable. Valid values: `schedule_entries`, `due_assignments`. Pass an empty array to disable all reminders.

Providing an invalid `platform` or `granularity` returns `422 Unprocessable Entity` with an error listing the valid options:

```json
{
"errors": [
"Invalid platform 'carrier_pigeon'. Valid options: web, email, web_and_email"
]
}
```

###### Example JSON Request
<!-- START PUT PAYLOAD /my/notifications/settings.json -->
```json
{
"platform": "email",
"granularity": "pings_and_mentions",
"schedule_enabled": true,
"schedule": {
"start_hour": 9,
"end_hour": 17,
"work_days": [1, 2, 3, 4, 5]
},
"bundle_enabled": true,
"reminders": ["schedule_entries", "due_assignments"]
}
```
<!-- END PUT PAYLOAD /my/notifications/settings.json -->

###### Copy as cURL

```shell
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"platform":"email","granularity":"pings_and_mentions"}' -X PUT \
https://3.basecampapi.com/$ACCOUNT_ID/my/notifications/settings.json
```


Snooze notifications
--------------------

* `PUT /my/notifications/snooze.json` will snooze the current user's notifications for the given duration. Returns `200 OK` with the snooze state.

**Required parameters**:

* `duration` - the number of seconds to snooze notifications.

###### Example JSON Response
<!-- START PUT /my/notifications/snooze.json -->
```json
{
"state": "snoozed",
"off_until": "2024-12-05T15:00:00Z"
}
```
<!-- END PUT /my/notifications/snooze.json -->

###### Example JSON Request
<!-- START PUT PAYLOAD /my/notifications/snooze.json -->
```json
{
"duration": 10800
}
```
<!-- END PUT PAYLOAD /my/notifications/snooze.json -->

###### Copy as cURL

```shell
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"duration":10800}' -X PUT \
https://3.basecampapi.com/$ACCOUNT_ID/my/notifications/snooze.json
```