Hi team,Is there a REST API to get the InputStream of a Repository?Seems like it was available in 1.0 APIshttps://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 repoAppPassword replace with an app password for this account that has at least Repositories: Read permissionsworkspace-id replace with the id of the workspace where the repo belongsrepo replace with your repo's slugmaster replace with the name of the branch you want to get the source code of
Kind regards,Theodora
It looks like you're new here. Sign in or register to get started.