8
votes

Question

How can my Github App get an access token that have the permission to create an issue?

What i tried

I enabled all the permissions in the Settings-> Developer settings -> GitHub Apps -> Permissions and webhook page, follow the instructions to get access token, then make a request referring the docs,but get the response below:

{ "message": "Resource not accessible by integration", "documentation_url": "https://developer.github.com/v3/issues/#create-an-issue" }

but everything work out fine when I use personal access token to make this request.

Details

Create a Github App

I enabled all the permissions

Subscribe all the events

Get access token

https://github.com/login/oauth/authorize?client_id=Iv1.abfa65bfc68dc75a

https://github.com/login/oauth/access_token

Request Create an issue

when I replace access_token I got from previous steps with my personal access token, everything work out fine.

1
Could you double check that you have installed the GitHub App on your ChenViViPage/test repository? You can click the "Install App" button in the GitHub App settings page. - Wilhelm Klopp

1 Answers

2
votes

Great, detailed write up of the issue you're encountering!

follow the instructions to get access token

I think this may be the cause of the issues you are running into. You've created a GitHub App, but you are looking at the instructions for authorizing OAuth Apps.

The docs for "Authenticating with GitHub Apps" are probably what you are looking for: https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/