- Notifications
You must be signed in to change notification settings - Fork1.1k
Api notifications#153
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
e1c140638b598d9a59a7130fa6db4e8c35e1aa03a7bf630a47b0761f7e518458b0c03b23fc996a038f90e4f5b280e45b1e40b2793ac3ef2c1395c47283b062fac7eb4f223a5b40ae5b805aad2d9647a89File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| title:Activity | GitHub API | ||
| --- | ||
| Serving up the 'social' in Social Coding™, the Activity APIs provide access to | ||
| notifications, subscriptions, and timelines. | ||
| ##Notifications | ||
| Notifications of new comments are delivered to users. The Notifications API | ||
| lets you view these notifications, and mark them as read. | ||
| ##Starring | ||
| Repository Starring is a feature that lets users bookmark repositories. Stars | ||
| are shown next to repositories to show an approximate level of interest. Stars | ||
| have no effect on notifications or the activity feed. | ||
| ##Watching | ||
| Watching a Repository registers the user to receive notificactions on new | ||
| discussions, as well as events in the user's activity feed. | ||
| ##Events | ||
| This is a read-only API of the events that power the various activity streams | ||
| on GitHub. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,218 @@ | ||
| --- | ||
| title: Notifications | GitHub API | ||
| --- | ||
| # Notifications API | ||
| * TOC | ||
| {:toc} | ||
| GitHub Notifications are powered by [watched repositories](/v3/repos/watching/). | ||
| Users receive notifications for discussions in repositories they watch | ||
| including: | ||
| * Issues and their comments | ||
| * Pull Requests and their comments | ||
| * Comments on any commits | ||
| Notifications are also sent for discussions in unwatched repositories when the | ||
| user is involved including: | ||
| * **@mentions** | ||
| * Issue assignments | ||
| * Commits the user authors or commits | ||
| * Any discussion in which the user actively participates | ||
| All Notification API calls require the <strong>"notifications"</strong> API | ||
| scope. Doing this will give read-only access to some Issue/Commit content. | ||
| You will still need the "repo" scope to access Issues and Commits from their | ||
| respective endpoints. | ||
| Notifications come back as "threads". A Thread contains information about the | ||
| current discussion of an Issue/PullRequest/Commit. | ||
| Notifications are optimized for polling with the "Last-Modified" header. If | ||
| there are no new notifications, you will see a "304 Not Modified" response, | ||
| leaving your current rate limit untouched. There is an "X-Poll-Interval" | ||
| header that specifies how often (in seconds) you are allowed to poll. In times | ||
| of high server load, the time may increase. Please obey the header. | ||
| # Add authentication to your requests | ||
| $ curl -I https://api.github.com/notifications | ||
| HTTP/1.1 200 OK | ||
| Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT | ||
| X-Poll-Interval: 60 | ||
| # Pass the Last-Modified header exactly | ||
| $ curl -I https://api.github.com/notifications | ||
| -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT" | ||
| HTTP/1.1 304 Not Modified | ||
| X-Poll-Interval: 60 | ||
| ## List your notifications | ||
| List all notifications for the current user, grouped by repository. | ||
| GET /notifications | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It might be better to use a URI template here: `/notifications{?all,participating,since} ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Ah dang, I should make all the urls into templates. Thanks for reminding me. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Also, do you prefer parameters or endpoints like | ||
| ### Parameters | ||
| all | ||
| : _Optional_ **boolean** `true` to show notifications marked as read. | ||
| participating | ||
| : _Optional_ **boolean** `true` to show only notifications in which the user is | ||
| directly participating or mentioned. | ||
| since | ||
| : _Optional_ **time** filters out any notifications updated before the given | ||
| time. The time should be passed in as UTC in the ISO 8601 format: | ||
| `YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z". | ||
| ### Response | ||
| <%= headers 200 %> | ||
| <%= json(:thread) { |h| [h] } %> | ||
| ## List your notifications in a repository | ||
| List all notifications for the current user. | ||
| GET /repos/:owner/:repo/notifications | ||
| ### Parameters | ||
| all | ||
| : _Optional_ **boolean** `true` to show notifications marked as read. | ||
| participating | ||
| : _Optional_ **boolean** `true` to show only notifications in which the user is | ||
| directly participating or mentioned. | ||
| since | ||
| : _Optional_ **time** filters out any notifications updated before the given | ||
| time. The time should be passed in as UTC in the ISO 8601 format: | ||
| `YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z". | ||
| ### Response | ||
| <%= headers 200 %> | ||
| <%= json(:thread) { |h| [h] } %> | ||
| ## Mark as read | ||
| Marking a notification as "read" removes it from the [default view | ||
| on GitHub.com](https://github.com/notifications). | ||
| PUT /notifications | ||
| ### Input | ||
| unread | ||
| : **Boolean** Changes the unread status of the threads. | ||
| read | ||
| : **Boolean** Inverse of "unread". | ||
| last_read_at | ||
| : _Optional_ **Time** Describes the last point that notifications were checked. Anything | ||
| updated since this time will not be updated. Default: Now. Expected in ISO | ||
| 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z". | ||
| ### Response | ||
| <%= headers 205 %> | ||
| ## Mark notifications as read in a repository | ||
| Marking all notifications in a repository as "read" removes them | ||
| from the [default view on GitHub.com](https://github.com/notifications). | ||
| PUT /repos/:owner/:repo/notifications | ||
| ### Input | ||
| unread | ||
| : **Boolean** Changes the unread status of the threads. | ||
| read | ||
| : **Boolean** Inverse of "unread". | ||
| last_read_at | ||
| : _Optional_ **Time** Describes the last point that notifications were checked. Anything | ||
| updated since this time will not be updated. Default: Now. Expected in ISO | ||
| 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z". | ||
| ### Response | ||
| <%= headers 205 %> | ||
| ## View a single thread | ||
| GET /notifications/threads/:id | ||
| ### Response | ||
| <%= headers 200 %> | ||
| <%= json(:thread) { |h| [h] } %> | ||
| ## Mark a thread as read | ||
| PATCH /notifications/threads/:id | ||
| ### Input | ||
| unread | ||
| : **Boolean** Changes the unread status of the threads. | ||
| read | ||
| : **Boolean** Inverse of "unread". | ||
| ### Response | ||
| <%= headers 205 %> | ||
| ## Get a Thread Subscription | ||
| This checks to see if the current user is subscribed to a thread. You can also | ||
| [get a Repository subscription](http://localhost:3000/v3/activity/watching/#get-a-repository-subscription). | ||
| GET /notifications/threads/1/subscription | ||
| ### Response | ||
| <%= headers 200 %> | ||
| <%= json :subscription %> | ||
| ## Set a Thread Subscription | ||
| This lets you subscribe to a thread, or ignore it. Subscribing to a thread | ||
| is unnecessary if the user is already subscribed to the repository. Ignoring | ||
| a thread will mute all future notifications (until you comment or get | ||
| @mentioned). | ||
| PUT /notifications/threads/1/subscription | ||
| ### Input | ||
| subscribed | ||
| : **boolean** Determines if notifications should be received from this | ||
| repository. | ||
| ignored | ||
| : **boolean** Deterimines if all notifications should be blocked from this | ||
| repository. | ||
| ### Response | ||
| <%= headers 200 %> | ||
| <%= json :subscription %> | ||
| ## Delete a Thread Subscription | ||
| DELETE /notifications/threads/1/subscription | ||
| ### Response | ||
| <%= headers 204 %> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| --- | ||
| title: Notification Settings | GitHub API | ||
| --- | ||
| # Notification Settings API | ||
| This API is not implemented. This documentation is a placeholder for when it | ||
| is ready for public consumption. | ||
| ## View Settings | ||
| GET /notifications/settings | ||
| ## Update Settings | ||
| Update the notification settings for the authenticated user. | ||
| PATCH /notifications/settings | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Well, we use PATCH everywhere else. Had a big discussion internally and on Twitter back when I was designing the API. Seems like a difference in the vague specs are interpreted. At least for now, I think going with PATCH for consistency is best. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. probably, i just hate patch so much fo this type of use case. | ||
| ### Parameters | ||
| participating.email | ||
| : _Optional_ **boolean** `true` to receive participating notificationsn via | ||
| email. | ||
| participating.web | ||
| : _Optional_ **boolean** `true` to receive participating notificationsn via | ||
| web. | ||
| watching.email | ||
| : _Optional_ **boolean** `true` to receive watching notificationsn via | ||
| email. | ||
| watching.web | ||
| : _Optional_ **boolean** `true` to receive watching notificationsn via | ||
| web. | ||
| <%= json \ | ||
| :participating => {:email => true, :web => false}, | ||
| :watching => {:email => true, :web => false} %> | ||
| ## Get notification email settings | ||
| GET /notifications/emails | ||
| ## Get the global email settings | ||
| GET /notifications/global/emails | ||
| ## Get notification email settings for an organization | ||
| GET /notifications/organization/:org/emails | ||
| ## Update email settings | ||
| PATCH /notifications/emails | ||
| ## Update global email settings | ||
| PUT /notifications/global/emails | ||
| ### Parameters | ||
| : _Required_ **string** Email address to which to send notifications to the | ||
| authenticated user for discussions related to projects for this organization. | ||
| ## Update Organization email settings | ||
| Update the notification settings for the authenticated user. | ||
| PUT /notifications/organization/:org/emails | ||
| ### Parameters | ||
| : _Required_ **string** Email address to which to send notifications to the | ||
| authenticated user for discussions related to projects for this organization. | ||
Uh oh!
There was an error while loading.Please reload this page.