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

Diff for pull request using bitbucket api v2 gives 403 forbidden

I am trying to check diff for the pull request using bitbucket api v2.

I am able to create the pull request using rest api but while merging I am getting merge conflicts so to check which file has conflicts, I am trying to check diff for the generated pullrequest.

But I am getting a 403 forbidden error.

Can someone please help me.



2 answers

It seems that it happens because redirect happens and authorization headers lost when in second request. This should help (just check for HttpStatusCode.Forbidden).

Note however that this API did not help me with finding conflicts. I finally use trick described here

jredmond Atlassian Team Jun 25, 2018

Why were you getting a redirect?

@jredmond because API officially returns `302` and many HTTP clients including .NET HttpClient does not pass authorization headers to the second request. 

Side question 1: What correct way to detect that PR is merge-able. The one I posted above with API V1?

Side question 2: Any chance PR ref ( will be implemented? 

Suggest an answer

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

Bitbucket Server 7.0 is here!

Hello Community, I’m Anton Genkin, a product manager on the Bitbucket Server and Data Center team and am excited to share that Bitbucket Server 7.0 is now available! It's a platform release, one th...

994 views 6 5
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