You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Are there any APIs for getting the content of a file without giving the sha of the commit which is mentioned here..
I tried https://api.bitbucket.org/2.0/repositories/myorg/myrepo/src/master/filename url to read the file and it works fine.
But if it's a feature branch or bugfix etc, and if we try https://api.bitbucket.org/2.0/repositories/myorg/myrepo/src/feature/my-branch/filename
it gives error as
This endpoint works with branch names that don't include the slash character ( / ) but it will not work for branches that have a slash in their name.
We have a bug report in our issue tracker here:
The bug report mentions the commit endpoint, but this applies to the src endpoint as well.
For these branches that include a slash in their name, you will need to provide a commit hash instead. You can use the following endpoint to get the commit hash of a branch's last commit:
You can filter the output to return only the commit hash with a url as follows: