Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 8

My Github App can access organization repo issues but can't access labels on an issue

A user has authorized my app to access a repo in an organization they are part of. I am able to list the repo's issues via

https://api.github.com/repos/{ORG}/{REPO}/issues

 

However, when I try to access the issue's labels like so:

 

https://api.github.com/repos/{ORG}/{REPO}/issues/1/labels

 

I get "Resource not accessible by integration"

7 Replies
Highlighted
Commander Lvl 1
Message 2 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

Hey, are you using the GitHub API v3 or v4? 

 

For v3 see: https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository

 



*Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!*
Highlighted
Copilot Lvl 3
Message 3 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

I'm using v3.

Highlighted
Commander Lvl 1
Message 4 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

Does that link help? Or is that not what you’re trying to do?


*Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!*
Highlighted
Copilot Lvl 3
Message 5 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

Hi Logan,

 

I'm already using the API as directed to get an issue's labels and it works in all other cases. In this specific case, where a user is part of a certain organization, I cannot access the labels on an issue even though I can access the issue. Seems to be a strange organization permission I don't understand.

 

Thanks

Matt

Highlighted
Commander Lvl 1
Message 6 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

Got it. Per https://developer.github.com/v3/apps/permissions/#permission-on-issues my suggestion is to make sure you also have pull request permission. Seems as though some of those are intertwined. I think that will do the trick.


*Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!*
Highlighted
Copilot Lvl 3
Message 7 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

I do have "read" permission for Pull requests. Here are all the permissions my app requests:

 

Repository permissions

Administration: read

Issues: read+write

Metadata: read

Pull requests: read

Projects: read

 

Organization permissions

Projects: read

Highlighted
Copilot Lvl 3
Message 8 of 8

Re: My Github App can access organization repo issues but can't access labels on an issue

To add to the confusion, I can't access a label search on this repo with an "access_token" on the URL. But if I remove the "access_token", then I can access the search. This is the exact repo and label that works with no access token:

 

https://api.github.com/search/labels?repository_id=9759448&q=docker

 

If I add a random access_token, I rightfully get "Bad credentials".

 

If I add the access_token that was granted to my app by a user that has admin permission on this repo, I get "Resource not accessible by integration".   🤷‍♂️