"Resource not available to integration" when trying to fetch diff as user for Github App

I have a GitHub app using a user token trying to make the following request (through octokit):

https://api.github.com/repos/hatboysam/diffmachine/compare/ss-old-code...ss-new-code

These are my headers:

Host: api.github.com
User-Agent: octokit-rest.js/18.0.0 octokit-core.js/3.0.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0
Accept: application/vnd.github.machine-man-preview.diff
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: http://localhost:8080/pr/hatboysam/diffmachine/5
authorization: token <REDACTED>
Origin: http://localhost:8080
DNT: 1
Connection: 

I get denied with “Resource not available to integration”. Note that this API request works perfectly without the authorization token header and my GitHub App has “Read only” access to “Contents”.

What am I doing wrong?

1 Like

:wave: hello there @hatboysam, and welcome to the GitHub Support Community!

If those branches are in a public repository, anyone (whether authenticating or not) should be able to make a request to that endpoint. If you’re still experiencing this, could you please send us the full output of a curl -v request that demonstrates the behavior?

That should help us investigate the issue. Also, please make sure you mask any sensitive information like OAuth tokens and Authorization headers in the output of the curl command.

1 Like