This repository was archived by the owner on Nov 1, 2017. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork1.1k
Remove unneeded files#385
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
2 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
186 changes: 186 additions & 0 deletionscontent/v3/activity/notifications.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
--- | ||
title: Notifications | GitHub API | ||
--- | ||
# Notifications | ||
* TOC | ||
{:toc} | ||
GitHub Notifications are powered by [watched repositories](/v3/activity/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 `notifications` or | ||
`repo` API scopes. 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 | ||
### Parameters | ||
Name | Type | Description | ||
-----|------|-------------- | ||
`all`|`boolean` | If `true`, show notifications marked as read. Default: `false` | ||
`participating`|`boolean` | If `true`, only shows notifications in which the user is directly participating or mentioned. Default: `false` | ||
`since`|`string` | Filters out any notifications updated before the given time. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Default: `Time.now` | ||
### 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 | ||
Name | Type | Description | ||
-----|------|-------------- | ||
`all`|`boolean` | If `true`, show notifications marked as read. Default: `false` | ||
`participating`|`boolean` | If `true`, only shows notifications in which the user is directly participating or mentioned. Default: `false` | ||
`since`|`string` | Filters out any notifications updated before the given time. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Default: `Time.now` | ||
### 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 | ||
### Parameters | ||
Name | Type | Description | ||
-----|------|-------------- | ||
`last_read_at`|`string` | Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Default: `Time.now` | ||
### 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 | ||
### Parameters | ||
Name | Type | Description | ||
-----|------|-------------- | ||
`last_read_at`|`string` | Describes the last point that notifications were checked. Anything updated since this time will not be updated. This is a timestamp in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. Default: `Time.now` | ||
### Response | ||
<%= headers 205 %> | ||
## View a single thread | ||
GET /notifications/threads/:id | ||
### Response | ||
<%= headers 200 %> | ||
<%= json(:thread) %> | ||
## Mark a thread as read | ||
PATCH /notifications/threads/:id | ||
### 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](/v3/activity/watching/#get-a-repository-subscription). | ||
GET /notifications/threads/:id/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/:id/subscription | ||
### Parameters | ||
Name | Type | Description | ||
-----|------|-------------- | ||
`subscribed`|`boolean`| Determines if notifications should be received from this thread | ||
`ignored`|`boolean`| Determines if all notifications should be blocked from this thread | ||
### Response | ||
<%= headers 200 %> | ||
<%= json :subscription %> | ||
## Delete a Thread Subscription | ||
DELETE /notifications/threads/:id/subscription | ||
### Response | ||
<%= headers 204 %> | ||
74 changes: 0 additions & 74 deletionscontent/v3/activity/settings.md
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.