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

User cannot access branch protection endpoint via API

 

We ran into a problem that is quite confusing - we have a user trying to access the endpoint:

 

/repos/:owner/:repo/branches/:branch/protection
 
via a curl call to the API. He consistently receives a "404 Not found
#get-required-status-checks-of-protected-branch" type error.
His access token is valid and works across other endpoints in the same repo, so it's not a credentials issue, for example. He *can* access:
 
/repos/:owner/:repo/branches/:branch
 
and it even lists the 'protection' url it claims to be unable to access. So all parameters, etc being passed are valid.
 
His access token has all boxes checked, so there should be no access restrictions in that regard.
 
He's using the "Accept: application/vnd.github.luke-cage-preview+json" header, so that is not a factor.
 
No other user is experiencing this issue.
 
I'm running out of ways to debug now. Is there something else that could be contributing to this access issue?

Thanks in advance!
 
 
 


 
2 Replies
Highlighted
Community Manager
Message 2 of 3

Re: User cannot access branch protection endpoint via API

Hi @mgoddard27,

 

Thanks for being here and our apologies for the delay in response. If you're still experiencing this, please reach out at https://support.github.com/ so we can take a look.


I hope this helps,
Andrea

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Highlighted
Pilot Lvl 1
Message 3 of 3

Re: User cannot access branch protection endpoint via API

@mgoddard27 

 

Can you check whether the user is an admin for that repo?  Or is he in a team that has admin access to the repo? Because branch protection is something that is restricted.

 

In the below example you can see that I can able to get the master branch details but I cannot get the branch protection details since I am not the admin for that repo.

 

Screen Shot 2020-03-11 at 2.04.54 PM.png

 

Regards

Parithiban G