Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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!

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,886 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you