Hi Team,
We have a requirement to get repo code using the Bitbucket API.
I am able to list all the api for a user, using basic auth, but while using the
, it gives a 404 error where I am passing the uuid of repo as the repo slug.
Thanks,
Sakshi
Tyler,
I have tried with the curl braces, but it gave a 404 exception. The repository is a private repository for which I have member access.
For getting the list of repositories, I have used
curl -X GET --user <username>:<password>https://api.bitbucket.org/2.0/repositories?role=member
and using the uuid for a repo,
curl -X GET --user <username>:<password> https://api.bitbucket.org/2.0/repositories/<username>/{<uuid_repo>}.
Do, let me know if I am missing a step.
Thanks,
Sakshi
Do you have 2-factor-auth / 2-step-verification disabled? If you use 2fa, you should authenticate using OAuth2 instead of basic auth.
More here: https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are using basic authentication for bitbucket in the org, hence that shouldn't be the cause for 404 error.
Also, I am able to get the repo list using
```curl -X GET --user <username>:<password>https://api.bitbucket.org/2.0/repositories?role=member ```.
Not sure how to proceed further for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the error response in the 404? It should have a JSON payload with more information about the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{
"type": "error",
"error": {
"message": "Repository <username>/{repo slug} not found"
}
}
Please note that I am a member of this repo , not owner.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My repo slug you mean repo UUID right? Or does the API call not work for <username>/<slug> either? That response usually means something about the owner name or slug was typed incorrectly, thus it cannot be found. If it was an authentication issue the response code would likely be a 403.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the API docs:
This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.
Are you using the curly-braces around the UUID?
Here's an example with a public repository:
https://api.bitbucket.org/2.0/repositories/mirror/%7Be14d6747-e69d-4ee3-a64a-a2ec8d3d5034%7D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gonchik,
I am able to get all the repository after passing the parameter of role and that's how I have received the uuid corresponding to a repository.
Although, when I am passing the same in the api as mentioned above, it is giving a 404 error.
Thanks,
Sakshi Barnwal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Let's get all repositoty,
without repo_slug parameter?
Cheers,
Gonchik Tsymzhitov
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are using basic authentication for bitbucket in the org, hence that shouldn't be the cause for 404 error.
Also, I am able to get the repo list using
```curl -X GET --user <username>:<password>https://api.bitbucket.org/2.0/repositories?role=member ```.
Not sure how to proceed further for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.