Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,362,110
Community Members
 
Community Events
168
Community Groups

Authorization problem using BB Server API to create PR

Hello!

I'm facing the following problem. I want to create a Pull Request using the Bitbucket Server API. This I want to achieve by doing the following CURL command from an automated process:

curl -X POST -k https://BITBUCKET-URL/rest/api/1.0/projects/{project-key}/repos/{repo}/pull-requests \
-H "X-Auth-Token: Bearer BITBUCKET-SECURITY-TOKEN" \
-H "Content-Type: application/json; charset=utf-8" \
-d @- << EOF
{
"PR-JSON": "CONTENT"
}
EOF

I replaced the sensitive information with placeholders.

The security token is correctly registered for a BB user. This token has admin rights. This user has rights to to Pull Requests manually.

What I'm getting back is this:

{"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]}

 What is going wrong here?

Thanks in advance for any help!

 

 

1 answer

Sorry, if this response is too late, but have you tried changing "X-Auth-Token" to "Authorization" ?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events