What is the API URL for bitbucket servers with alternate basenames?

wspear October 28, 2020

I need to do some simple API queries on a few open source projects. This is quite straightforward for projects hosted at bitbucket.org, with the API for a given project looking like: https://api.bitbucket.org/2.0/repositories/<REPO>/<PROJECT>

But I need to access the API for a project with a custom/business base url like: https://bitbucket.hdfgroup.org/projects/HDFFV/repos/hdf5

I haven't been able to find any documentation on this and my various permutations on api as part of the basename (or adding it to the path) haven't turned up anything either. I assume/hope the API is still available for repos with this configuration, but I would very much appreciate some direction.

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2020

Hello and welcome to the community!

https://api.bitbucket.org/2.0/repositories/<REPO>/<PROJECT> can be used for Bitbucket Cloud repos, hosted on https://bitbucket.org/.

An instance with a URL like https://bitbucket.hdfgroup.org/ is a Bitbucket Server instance (self-hosted) and the API is different.

The following documentation has a list of REST resources for Bitbucket Server (version 7.7.0):

Kind regards,
Theodora

wspear October 30, 2020

Thanks! That did the trick. If anyone else finds this thread the solution for the repo in question looks like:

https://<BASE>/rest/api/1.0/projects/<REPO>/repos/<PROJECT>

But the REST documentation makes it pretty clear what's worth trying if a repo's API URL doesn't exactly conform to that pattern.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events