Skip to content

Commit 2e25329

Browse files
committed
update watching/starring api docs
1 parent e789021 commit 2e25329

File tree

3 files changed

+125
-24
lines changed

3 files changed

+125
-24
lines changed

content/v3/repos/starring.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Repository Starring | GitHub API
3+
---
4+
5+
# Repository Starring API
6+
7+
Repository Starring is a feature that lets users bookmark repositories. Stars
8+
are shown next to repositories to show an approximate level of interest. Stars
9+
have no effect on notifications or the activity feed. For that, see [Repository
10+
Watching](/v3/repos/watching).
11+
12+
We recently [changed the way watching
13+
works](https://github.com/blog/1204-notifications-stars) on GitHub. Many 3rd
14+
party applications may be using the "watcher" endpoints for accessing these.
15+
Starting today, you can start changing these to the new "star" endpoints. See
16+
below.
17+
18+
## List Stargazers
19+
20+
# Using github.v3 media type.
21+
GET /repos/:user/:repo/stargazers
22+
23+
# Legacy, using github.beta media type..
24+
GET /repos/:user/:repo/watchers
25+
26+
### Response
27+
28+
<%= headers 200, :pagination => true %>
29+
<%= json(:user) { |h| [h] } %>
30+
31+
## List repositories being starred
32+
33+
List repositories being starred by a user.
34+
35+
# Using github.v3 media type.
36+
GET /users/:user/starred
37+
38+
# Legacy, using github.beta media type.
39+
GET /users/:user/watched
40+
41+
List repositories being watched by the authenticated user.
42+
43+
# Using github.v3 media type.
44+
GET /user/starred
45+
46+
# Legacy, using github.beta media type.
47+
GET /user/watched
48+
49+
### Response
50+
51+
<%= headers 200, :pagination => true %>
52+
<%= json(:repo) { |h| [h] } %>
53+
54+
## Check if you are starring a repository
55+
56+
Requires for the user to be authenticated.
57+
58+
# Using github.v3 media type.
59+
GET /user/starred/:user/:repo
60+
61+
# Legacy, using github.beta media type.
62+
GET /user/watched/:user/:repo
63+
64+
### Response if this repository is watched by you
65+
66+
<%= headers 204 %>
67+
68+
### Response if this repository is not watched by you
69+
70+
<%= headers 404 %>
71+
72+
## Star a repository
73+
74+
Requires for the user to be authenticated.
75+
76+
# Using github.v3 media type.
77+
PUT /user/starred/:user/:repo
78+
79+
# Legacy, using github.beta media type.
80+
PUT /user/watched/:user/:repo
81+
82+
### Response
83+
84+
<%= headers 204 %>
85+
86+
## Unstar a repository
87+
88+
Requires for the user to be authenticated.
89+
90+
# Using github.v3 media type.
91+
DELETE /user/starred/:user/:repo
92+
93+
# Legacy, using github.beta media type.
94+
DELETE /user/watched/:user/:repo
95+
96+
### Response
97+
98+
<%= headers 204 %>

content/v3/repos/watching.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,71 @@
11
---
2-
title: Repo Watching | GitHub API
2+
title: Repository Watching | GitHub API
33
---
44

5-
# Repo Watching API
5+
# Repository Watching API
6+
7+
Watching a Repository registers the user to receive notificactions on new
8+
discussions, as well as events in the user's activity feed. See [Repository
9+
Starring](/v3/repos/starring) for simple repository bookmarks.
610

711
We recently [changed the way watching
8-
works](https://github.com/blog/1204-notifications-stars) on GitHub. We hope to
9-
roll out many of these features in the API soon. Until then, the [Watchers
10-
method](#list-watchers) below will return "stargazers", and the [Watched
11-
methods](#list-repos-being-watched) return repositories that have been
12-
"starred."
12+
works](https://github.com/blog/1204-notifications-stars) on GitHub. Until 3rd
13+
party applications stop using the "watcher" endpoints for the current Starring
14+
API, the Watching API will use the below "subscription" endpoints.
1315

1416
## List watchers
1517

16-
GET /repos/:user/:repo/watchers
18+
GET /repos/:user/:repo/subscribers
1719

1820
### Response
1921

2022
<%= headers 200, :pagination => true %>
2123
<%= json(:user) { |h| [h] } %>
2224

23-
## List repos being watched
25+
## List repositories being watched
2426

25-
List repos being watched by a user
27+
List repositories being watched by a user.
2628

27-
GET /users/:user/watched
29+
GET /users/:user/subscriptions
2830

29-
List repos being watched by the authenticated user
31+
List repositories being watched by the authenticated user.
3032

31-
GET /user/watched
33+
GET /user/subscriptions
3234

3335
### Response
3436

3537
<%= headers 200, :pagination => true %>
3638
<%= json(:repo) { |h| [h] } %>
3739

38-
## Check if you are watching a repo
40+
## Check if you are watching a repository
3941

40-
Requires for the user to be authenticated
42+
Requires for the user to be authenticated.
4143

42-
GET /user/watched/:user/:repo
44+
GET /user/subscriptions/:user/:repo
4345

44-
### Response if this repo is watched by you
46+
### Response if this repository is watched by you
4547

4648
<%= headers 204 %>
4749

48-
### Response if this repo is not watched by you
50+
### Response if this repository is not watched by you
4951

5052
<%= headers 404 %>
5153

52-
## Watch a repo
54+
## Watch a repository
5355

54-
Requires for the user to be authenticated
56+
Requires for the user to be authenticated.
5557

56-
PUT /user/watched/:user/:repo
58+
PUT /user/subscriptions/:user/:repo
5759

5860
### Response
5961

6062
<%= headers 204 %>
6163

62-
## Stop watching a repo
64+
## Stop watching a repository
6365

64-
Requires for the user to be authenticated
66+
Requires for the user to be authenticated.
6567

66-
DELETE /user/watched/:user/:repo
68+
DELETE /user/subscriptions/:user/:repo
6769

6870
### Response
6971

layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ <h3><a href="#" class="js-expand-btn collapsed">&nbsp;</a><a href="/v3/repos/">R
9595
<li><a href="/v3/repos/keys/">Keys</a></li>
9696
<li><a href="/v3/repos/hooks/">Hooks</a></li>
9797
<li><a href="/v3/repos/merging/">Merging</a></li>
98+
<li><a href="/v3/repos/starring/">Starring</a></li>
9899
<li><a href="/v3/repos/statuses/">Statuses</a></li>
99100
<li><a href="/v3/repos/watching/">Watching</a></li>
100101
</ul>

0 commit comments

Comments
 (0)