I'm currently attempting to check and see if a repo is starred by an authenticated user using the GitHub API (v3). I can successfully list the repos starred by the logged in user, but I can't seem to get it to work when checking if a repo is starred by the user.
For instance..
(GET) /user/starred?access_token=... correctly returns the full list of repos I have starred.
(GET) /user/starred/joynet/node?access_token=... always returns status 404, no matter what owner/repo combination I use or if I actually have that repo starred or not.
I should also note that I can't seem to access anything at /user/starred except (GET) /user/starred. Any request to PUT, DELETE, or POST to /user/starred/:owner/:repo returns a 404, no matter what I do.
Any idea how I'm supposed to be using this API? I've read the documentation, and this I believe I'm doing it correctly, but I just can't seem to get it work.
These information is now available in the About section of the repository on the right side of the page beside the code section. The numbers before 'star' and 'watching' are clickable.
Users on the GitHub website are able to "star" other people's repositories, thereby saving them in their list of Starred Repos. Some people use "stars" to indicate that they like a project, other people use them as bookmarks so they can follow what's going on with the repo later.
You can use the github api for this. Hitting https://api.github.com/users/USERNAME/repos will list public repositories for the user USERNAME.
GitHub REST APIs allow users to communicate with GitHub and extract the desired information effectively by using an authenticated access token. With GitHub REST APIs, you can easily create and manage repositories, issues, branches, and more, with only a few lines of code.
I was able to solve this problem. The issue was I skimmed the documentation and didn't see I had to request the repo scope during authorization to be able to modify stars :) Simply adding the "repo" scope fixed my issue!
GitHub briefly mentions their scopes here: http://developer.github.com/v3/oauth/ but no where was it mentioned that starring needs the "repo" scope.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With