Check user access for a given repo


#1

I have build a Github App which creates code reports for each commit, this app works fine.

Now I want to make this report accessible to all users wich have access to the related repo.
I want to do this via the OAuth possibilities of the Github App.

My OAuth Login through the App works, I god a User access token.
If I call https://api.github.com/user with this token everything looks fine.
But If I read https://api.github.com/repos// I got a 404.
Under https://api.github.com/orgs//repos I only got the public repos.

How can I verify that a OAuth User of my App has access to a specific private repo?


#2

You want api.github.com/user/installations and api.github.com/user/installation/:installation_id/repositories

It has to be a two-step process, I’m afraid.


#3

Step one works and gives me

  "installations": [
    {
      "id": 99999,

But, if I fetch api.github.com/user/installation/99999/repositories I got a 404.


#4

My error. It’s installations, not installation in that second URL, too.


#5

It works, thx.

It would be great to have the ability to check this with a single call.

Why does /repos/<org>/<name> didn’t work?