Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commitc0fae72

Browse files
committed
Merge pull request#153 from github/api-notifications
Api notifications
2 parents341f263 +9647a89 commitc0fae72

File tree

10 files changed

+438
-22
lines changed

10 files changed

+438
-22
lines changed

‎content/v3/activity.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title:Activity | GitHub API
3+
---
4+
5+
Serving up the 'social' in Social Coding™, the Activity APIs provide access to
6+
notifications, subscriptions, and timelines.
7+
8+
##Notifications
9+
10+
Notifications of new comments are delivered to users. The Notifications API
11+
lets you view these notifications, and mark them as read.
12+
13+
##Starring
14+
15+
Repository Starring is a feature that lets users bookmark repositories. Stars
16+
are shown next to repositories to show an approximate level of interest. Stars
17+
have no effect on notifications or the activity feed.
18+
19+
##Watching
20+
21+
Watching a Repository registers the user to receive notificactions on new
22+
discussions, as well as events in the user's activity feed.
23+
24+
##Events
25+
26+
This is a read-only API of the events that power the various activity streams
27+
on GitHub.
28+

‎content/v3/events.md‎renamed to ‎content/v3/activity/events.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,23 @@ various activity streams on the site.
1010
* TOC
1111
{:toc}
1212

13+
Events are optimized for polling with the "ETag" header. If no new events have
14+
been triggered, you will see a "304 Not Modified" response, and your current
15+
rate limit will be untouched. There is also an "X-Poll-Interval" header that
16+
specifies how often (in seconds) you are allowed to poll. In times of high
17+
server load, the time may increase. Please obey the header.
18+
19+
$ curl -I https://api.github.com/users/tater/events
20+
HTTP/1.1 200 OK
21+
X-Poll-Interval: 60
22+
ETag: "a18c3bded88eb5dbb5c849a489412bf3"
23+
24+
# The quotes around the ETag value are important
25+
$ curl -I https://api.github.com/users/tater/events \
26+
-H 'If-None-Match: "a18c3bded88eb5dbb5c849a489412bf3"'
27+
HTTP/1.1 304 Not Modified
28+
X-Poll-Interval: 60
29+
1330
Events support[pagination](/v3/#pagination),
1431
however the`per_page` option is unsupported. The fixed page size is 30 items.
1532
Fetching up to ten pages is supported, for a total of 300 events.
File renamed without changes.
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
title:Notifications | GitHub API
3+
---
4+
5+
#Notifications API
6+
7+
* TOC
8+
{:toc}
9+
10+
GitHub Notifications are powered by[watched repositories](/v3/repos/watching/).
11+
Users receive notifications for discussions in repositories they watch
12+
including:
13+
14+
* Issues and their comments
15+
* Pull Requests and their comments
16+
* Comments on any commits
17+
18+
Notifications are also sent for discussions in unwatched repositories when the
19+
user is involved including:
20+
21+
***@mentions**
22+
* Issue assignments
23+
* Commits the user authors or commits
24+
* Any discussion in which the user actively participates
25+
26+
All Notification API calls require the <strong>"notifications"</strong> API
27+
scope. Doing this will give read-only access to some Issue/Commit content.
28+
You will still need the "repo" scope to access Issues and Commits from their
29+
respective endpoints.
30+
31+
Notifications come back as "threads". A Thread contains information about the
32+
current discussion of an Issue/PullRequest/Commit.
33+
34+
Notifications are optimized for polling with the "Last-Modified" header. If
35+
there are no new notifications, you will see a "304 Not Modified" response,
36+
leaving your current rate limit untouched. There is an "X-Poll-Interval"
37+
header that specifies how often (in seconds) you are allowed to poll. In times
38+
of high server load, the time may increase. Please obey the header.
39+
40+
# Add authentication to your requests
41+
$ curl -I https://api.github.com/notifications
42+
HTTP/1.1 200 OK
43+
Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
44+
X-Poll-Interval: 60
45+
46+
# Pass the Last-Modified header exactly
47+
$ curl -I https://api.github.com/notifications
48+
-H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
49+
HTTP/1.1 304 Not Modified
50+
X-Poll-Interval: 60
51+
52+
##List your notifications
53+
54+
List all notifications for the current user, grouped by repository.
55+
56+
GET /notifications
57+
58+
###Parameters
59+
60+
all
61+
:_Optional_**boolean**`true` to show notifications marked as read.
62+
63+
participating
64+
:_Optional_**boolean**`true` to show only notifications in which the user is
65+
directly participating or mentioned.
66+
67+
since
68+
:_Optional_**time** filters out any notifications updated before the given
69+
time. The time should be passed in as UTC in the ISO 8601 format:
70+
`YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z".
71+
72+
###Response
73+
74+
<%= headers 200 %>
75+
<%= json(:thread) { |h|[h] } %>
76+
77+
##List your notifications in a repository
78+
79+
List all notifications for the current user.
80+
81+
GET /repos/:owner/:repo/notifications
82+
83+
###Parameters
84+
85+
all
86+
:_Optional_**boolean**`true` to show notifications marked as read.
87+
88+
participating
89+
:_Optional_**boolean**`true` to show only notifications in which the user is
90+
directly participating or mentioned.
91+
92+
since
93+
:_Optional_**time** filters out any notifications updated before the given
94+
time. The time should be passed in as UTC in the ISO 8601 format:
95+
`YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z".
96+
97+
###Response
98+
99+
<%= headers 200 %>
100+
<%= json(:thread) { |h|[h] } %>
101+
102+
##Mark as read
103+
104+
Marking a notification as "read" removes it from the[default view
105+
on GitHub.com](https://github.com/notifications).
106+
107+
PUT /notifications
108+
109+
###Input
110+
111+
unread
112+
:**Boolean** Changes the unread status of the threads.
113+
114+
read
115+
:**Boolean** Inverse of "unread".
116+
117+
last_read_at
118+
:_Optional_**Time** Describes the last point that notifications were checked. Anything
119+
updated since this time will not be updated. Default: Now. Expected in ISO
120+
8601 format:`YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z".
121+
122+
###Response
123+
124+
<%= headers 205 %>
125+
126+
##Mark notifications as read in a repository
127+
128+
Marking all notifications in a repository as "read" removes them
129+
from the[default view on GitHub.com](https://github.com/notifications).
130+
131+
PUT /repos/:owner/:repo/notifications
132+
133+
###Input
134+
135+
unread
136+
:**Boolean** Changes the unread status of the threads.
137+
138+
read
139+
:**Boolean** Inverse of "unread".
140+
141+
last_read_at
142+
:_Optional_**Time** Describes the last point that notifications were checked. Anything
143+
updated since this time will not be updated. Default: Now. Expected in ISO
144+
8601 format:`YYYY-MM-DDTHH:MM:SSZ`. Example: "2012-10-09T23:39:01Z".
145+
146+
###Response
147+
148+
<%= headers 205 %>
149+
150+
##View a single thread
151+
152+
GET /notifications/threads/:id
153+
154+
###Response
155+
156+
<%= headers 200 %>
157+
<%= json(:thread) { |h|[h] } %>
158+
159+
##Mark a thread as read
160+
161+
PATCH /notifications/threads/:id
162+
163+
###Input
164+
165+
unread
166+
:**Boolean** Changes the unread status of the threads.
167+
168+
read
169+
:**Boolean** Inverse of "unread".
170+
171+
###Response
172+
173+
<%= headers 205 %>
174+
175+
##Get a Thread Subscription
176+
177+
This checks to see if the current user is subscribed to a thread. You can also
178+
[get a Repository subscription](http://localhost:3000/v3/activity/watching/#get-a-repository-subscription).
179+
180+
GET /notifications/threads/1/subscription
181+
182+
###Response
183+
184+
<%= headers 200 %>
185+
<%= json:subscription %>
186+
187+
##Set a Thread Subscription
188+
189+
This lets you subscribe to a thread, or ignore it. Subscribing to a thread
190+
is unnecessary if the user is already subscribed to the repository. Ignoring
191+
a thread will mute all future notifications (until you comment or get
192+
@mentioned).
193+
194+
PUT /notifications/threads/1/subscription
195+
196+
###Input
197+
198+
subscribed
199+
:**boolean** Determines if notifications should be received from this
200+
repository.
201+
202+
ignored
203+
:**boolean** Deterimines if all notifications should be blocked from this
204+
repository.
205+
206+
###Response
207+
208+
<%= headers 200 %>
209+
<%= json:subscription %>
210+
211+
##Delete a Thread Subscription
212+
213+
DELETE /notifications/threads/1/subscription
214+
215+
###Response
216+
217+
<%= headers 204 %>
218+

‎content/v3/activity/settings.md‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title:Notification Settings | GitHub API
3+
---
4+
5+
#Notification Settings API
6+
7+
This API is not implemented. This documentation is a placeholder for when it
8+
is ready for public consumption.
9+
10+
##View Settings
11+
12+
GET /notifications/settings
13+
14+
##Update Settings
15+
16+
Update the notification settings for the authenticated user.
17+
18+
PATCH /notifications/settings
19+
20+
###Parameters
21+
22+
participating.email
23+
:_Optional_**boolean**`true` to receive participating notificationsn via
24+
email.
25+
26+
participating.web
27+
:_Optional_**boolean**`true` to receive participating notificationsn via
28+
web.
29+
30+
watching.email
31+
:_Optional_**boolean**`true` to receive watching notificationsn via
32+
email.
33+
34+
watching.web
35+
:_Optional_**boolean**`true` to receive watching notificationsn via
36+
web.
37+
38+
<%= json\
39+
:participating => {:email => true,:web => false},
40+
:watching => {:email => true,:web => false} %>
41+
42+
##Get notification email settings
43+
44+
GET /notifications/emails
45+
46+
##Get the global email settings
47+
48+
GET /notifications/global/emails
49+
50+
##Get notification email settings for an organization
51+
52+
GET /notifications/organization/:org/emails
53+
54+
##Update email settings
55+
56+
PATCH /notifications/emails
57+
58+
##Update global email settings
59+
60+
PUT /notifications/global/emails
61+
62+
###Parameters
63+
64+
email
65+
:_Required_**string** Email address to which to send notifications to the
66+
authenticated user for discussions related to projects for this organization.
67+
68+
##Update Organization email settings
69+
70+
Update the notification settings for the authenticated user.
71+
72+
PUT /notifications/organization/:org/emails
73+
74+
###Parameters
75+
76+
email
77+
:_Required_**string** Email address to which to send notifications to the
78+
authenticated user for discussions related to projects for this organization.
79+
File renamed without changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp