Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github API : What permission should a Github App get when create an issue

Tags:

github-api

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.

like image 298
ValoraChen Avatar asked Jul 14 '18 06:07

ValoraChen


People also ask

How do I authorize an app on GitHub?

You can select user-level permissions from within your GitHub App's settings in the User permissions section of the Permissions & webhooks page. For more information on selecting permissions, see "Editing a GitHub App's permissions."

What are GitHub permissions?

About access permissions on GitHub A permission is the ability to perform a specific action. For example, the ability to delete an issue is a permission. A role is a set of permissions you can assign to individuals or teams. Roles work differently for different types of accounts.

How do I know if I have permission to repository on GitHub?

A very easy way to check is whether you see an edit 'pencil' icon in the top right of the README.MD on the main Code page of the repo (scroll down to it if there's a long list of top level files/folders). Do this when you are logged in to Github, obviously.


1 Answers

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/

like image 56
Wilhelm Klopp Avatar answered Nov 20 '22 09:11

Wilhelm Klopp