I am trying to compare 2 branches of particular repository. It is giving error "This endpoint does not support token-based authentication"
the rest end point is : https://bitbucket.org/<id>/<repo_name>/branches/compare/<bramcn_name>%0Ddevelop
I have passed token and content type in to header. The same is worked for other endpoints.
Hi @Abbas Mohammed,
The URL that you posted can be used to compare two branches from browser. I'm afraid that it is not a REST API endpoint, which I believe is the reason for the error you get.
If you would like to get the diff of two branches via REST API, you can use the following endpoint:
This is for comparing commits and branches as well. If you want to compare two branches, then the URL should look as follows:
https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/diff/feature..main
where
workspace-id replace with the id of the workspace where the repo belongs
repo-slug replace with the slug of this repo
feature replace with the name of the source branch
main replace with the name of the destination branch
Please feel free to let me know how it goes and if you have any questions.
Kind regards,
Theodora
Thanks, it is working fine.
As I need to know whether source branch is merged to destination or not, I used /diffstat/
i.e.,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abbas,
Thank you for the update! It's good to hear that it is working well for you.
There is no other endpoint that provides this info for branches. You can get that info for a specific pull request from this endpoint, but for branches you can use the diffstat one.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.