'Retrieving security alerts using rest api

I am following the indications mentioned here, trying to retrieve the alerts but I always get a return error of 404, even though I am an owner in my organization. When I try to the same but for a public repo in the organization, it works as expected. I’ve tried re-authenticating my self, create a new Personal Access token and pass it in the header, but still I get a 404. Am I missing something?

  curl \                                                                                                                           
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/<OrgName>/code-scanning/alerts

With thepersonal access token in the request: -H 'Authorization: token <My_Token>' but I get the same exact message.

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-by-organization"
}

Also tried it using the github cli which already has me authenticated Did I find a bug?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source