Hi,
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:
https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/refs/branches/feature/mu-feature-branch?fields=target.hash
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.