Skip to content

Commit 731ccf7

Browse files
committed
draft of watcher api changes
1 parent 0fff083 commit 731ccf7

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Upcoming Changes to Watcher and Star APIs
3+
---
4+
5+
We recently [changed the Watcher behavior][change-watching] on GitHub. What
6+
used to be known as "Watching", is now "Starring". Starring is basically
7+
a way to bookmark interesting repositories. Watching is a way to indicate that
8+
you want to receive email or web notifications on a Repository.
9+
10+
[change-watching]: https://github.com/blog/1204-notifications-stars
11+
12+
This works well on GitHub.com, but poses a problem for the GitHub API. How do
13+
we change this in a way that developers can gracefully upgrade their
14+
applications? We're currently looking at rolling out the changes in three
15+
phases over an extended period of time.
16+
17+
## Current Status
18+
19+
The current [Repository Starring][starring-api] methods look like this:
20+
21+
* `/repos/:owner/:repo/watchers` - A list of users starring the repository.
22+
* `/users/:user/watched` - A list of repositories that a user has starred.
23+
* `/users/watched` - A list of repositories the current user has starred.
24+
25+
[starring-api]: http://developer.github.com/v3/repos/watching/
26+
27+
## Phase 1: Add Watchers as Subscriptions
28+
29+
In addition to this, we'll expose Watchers as "Subscriptions". This is to
30+
keep from clashing with the legacy endpoint.
31+
32+
* `/repos/:owner/:repo/subscribers` - A list of users watching the repository.
33+
* `/users/subscriptions` - A list of repositories the current user is watching.
34+
35+
Note: we don't plan to expose what other users are watching.
36+
37+
We'll also add a copy of the legacy Watchers API in the new endpoint:
38+
39+
* `/repos/:owner/:repo/stargazers` - A list of users starring the repository.
40+
* `/users/:user/starred` - A list of repositories that a user has starred.
41+
* `/users/starred` - A list of repositories the current user has starred.
42+
43+
This will be done with the current mime type for the API:
44+
45+
application/vnd.github.beta+json
46+
47+
If you care about your application not breaking, make sure all outgoing API
48+
requests pass that value for the "Accept" header.
49+
50+
# Accesses a user's starred repositories.
51+
curl https://api.github.com/users/watched \
52+
-H "Accept: application/vnd.github.beta+json"
53+
54+
## Phase 2: Switch `/watchers` API Endpoint
55+
56+
The "watch" endpoints will now be a copy of the "subscription" endpoints. You
57+
will have to use `/users/starred` to get a user's starred repositories, not
58+
`/users/watched`.
59+
60+
This requires a new mime type value:
61+
62+
application/vnd.github.v3+json
63+
64+
We will release this change in an experimental mode first, letting developers
65+
gracefully upgrade their applications by specifying the new mime value for the
66+
Accept header.
67+
68+
# Accesses a user's watched repositories.
69+
curl https://api.github.com/users/watched \
70+
-H "Accept: application/vnd.github.v3+json"
71+
72+
## Phase 3: Remove `/subscribers` API Endpoint.
73+
74+
This phase involves disabling the subscription endpoints completely. At this
75+
point, you should be using the starring endpoints for starred repositories, and
76+
the watch endpoints for watched repositories.
77+

0 commit comments

Comments
 (0)