Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

GitHub Issues Rest API returns 404

I am trying to access the issues assigned to a user (me, in this case) using GitHub’s Rest API: GitHub Issues API

I am just using Postman.

What I have done:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

URL: https://api.github.com/issues

Method: GET

Headers: Accept: application/vnd.github.v3+json & Authorization: token {my_token}

The above returns:

{
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/issues#list-issues-assigned-to-the-authenticated-user"
}

I know the token works because the API works fine if I try to fetch the user information using /user or list a repository’s issues using /repos/{owner}/{repo}/issues. I created a few issues in a repo so I know it’s not empty.

What am I doing wrong here?

>Solution :

It seems that your personal access token does not have the required OAuth scopes to access the information provided on the /issues endpoint. Somehow GitHub requires at least the public_repo scope to get issues in public repositories meeting your criteria (depending on request parameters) instead of the 404 status code.

When your token has the public_repo scope, either you will receive the issues or an empty array ([]). To access issues in private repositories, you need the (full) repo scope.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading