Bitbucket API giving 404?
Asked by Jonathan Kelley:

Trying to get started with the API. Something simple, like list projects, [\[api doc link\]](https://developer.atlassian.com/server/bitbucket/rest/v807/api-group-project/#api-api-latest-projects-get)

It says GET 'http://{baseurl}/rest/api/latest/projects'

Looking for baseurl, official docs say this "[intro](https://developer.atlassian.com/server/bitbucket/rest/v807/intro/#intro)":

*<http://host:port/context/rest/api-name/api-version/path/to/resource>*

*For example, the following URI would retrieve a page of the latest commits to the jira repository in the Jira project*

*<https://bitbucket.example.com/rest/api/1.0/projects/JIRA/repos/jira/commits>*  
So when I try this for bitbucket:  
**<https://bitbucket.org/rest/api/latest/projects> \<\< What the documentation would suggest should work [\[api doc link\]](https://developer.atlassian.com/server/bitbucket/rest/v807/api-group-project/#api-api-latest-projects-get)**  
<https://bitbucket.org/rest/api/1.0/latest/projects> \<\< An effort to understand  
<https://bitbucket.org/rest/api/2.0/latest/projects> \<\< An effort to understand  
It's all just 404.  
Why is this resource not found?


Answers:
author: Ulrich Kuhnhardt _IzymesCo_
body: Hi Johnathan,

you're mixing Bitbucket cloud (bitbucket.org/...) with Bitbucket server/datacenter (yourdomain.com/....)

Bitbucket cloud (Atlassian hosts) is a different implementation with a different REST API compared to Bitbucket server/Datacenter (you host)

Here are the respective REST APIs

Server/DC : <https://developer.atlassian.com/server/bitbucket/rest/v807/intro/>

Cloud: <https://developer.atlassian.com/cloud/bitbucket/rest/intro/>

Hope that helps!

Happy coding, Ulrich

// [Izymes](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd) - Bitbucket tools for busy teams


author: Jonathan Kelley
body: Also when looking into online examples, or examples within my own organization, here's what bitbucket API urls typically look like:  
**url = f'<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_template}/forks>'**

```
 curl https://api.bitbucket.org/2.0/repositories/{accountname}
```

```
 curl --user {accountname}:{app_password} https://api.bitbucket.org/1.0/user/
```

```
curl --user {accountname}:{app_password} https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/issues??
```

Of course, these working URL scheme is not documented in the "[intro](https://developer.atlassian.com/server/bitbucket/rest/v807/intro/#intro)" section: but it does vaguely conform to \`<http://host:port/context/rest/api-name/api-version/path/to/resource>\`

comments: author: Jonathan Kelley
body: However, starting with anyone elses working endpoint URL as an example does not work.  

url = '<https://api.bitbucket.org/2.0/latest/projects>' is yet another 404.  
url = '[https://api.bitbucket.org/1.0/latest/projects](https://api.bitbucket.org/2.0/latest/projects)' is yet another 404.  

<br />

Is there a way to access this API resource?   
<https://developer.atlassian.com/server/bitbucket/rest/v807/api-group-project/#api-api-latest-projects-get>

The docs don't mention what version this resource version of the API is at currently (1.0, 2.0), which seems a bit confusing as well.

<br />

<br />

<br />


Tags: bitbucket-cloud

cloud