githubpostmangithub-api-v3

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:

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.