Hi team,
Is there a REST API to get the InputStream of a Repository?
Seems like it was available in 1.0 APIs
https://docs.atlassian.com/bitbucket-server/rest/7.14.0/bitbucket-rest.html#idp199
Hi @Vipin Kumar and welcome to the community!
Are you looking to get an archive of a repository hosted in Bitbucket Cloud or Bitbucket Server? Your question has the tag 'bitbucket-cloud', but the API endpoint you posted is of Bitbucket Server.
Bitbucket Cloud has a different API (its documentation is here: https://developer.atlassian.com/cloud/bitbucket/rest/intro/).
There is no API endpoint to download an archive of a Bitbucket Cloud repo, but you can use a curl command like the following to get an archive of the source code in e.g. the master branch:
curl -u BitbucketUsername:AppPassword https://bitbucket.org/workspace-id/repo/get/master.tar.gz -o master.tar.gz
where
BitbucketUsername replace with the username of a Bitbucket Cloud account with access to the repo
AppPassword replace with an app password for this account that has at least Repositories: Read permissions
workspace-id replace with the id of the workspace where the repo belongs
repo replace with your repo's slug
master replace with the name of the branch you want to get the source code of
Kind regards,
Theodora
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.