Skip to content

Commit 40b2793

Browse files
committed
Event polling instructions
1 parent 0e45b1e commit 40b2793

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

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.

0 commit comments

Comments
 (0)