Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bitbucket API giving 404?

Edited

Trying to get started with the API. Something simple, like list projects, [api doc link]

 

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

 

Looking for baseurl, official docs say this "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 

 

 
So when I try this for bitbucket:
https://bitbucket.org/rest/api/latest/projects << What the documentation would suggest should work  [api doc link]
It's all just 404.
Why is this resource not found?

2 answers

1 vote
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Jan 15, 2023

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 - Bitbucket tools for busy teams

Also when looking into online examples, or examples within my own organization, here's what bitbucket API urls typically look like:

 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" section: but it does vaguely conform to `http://host:port/context/rest/api-name/api-version/path/to/resource`

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' is yet another 404.


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.




Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events