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

Unable to list all my respositories using Bitbucket clould API

I am using my Bitbucket APP password to list all my repositories.

However, I am unable to perform through REST API

 

import requests
import json
url = "https://api.bitbucket.org/2.0/repositories/MY-ORG?role=member"

headers = {
"Accept": "application/json",
"Authorization": "MY-APP-PASSWORD"
}

response = requests.request(
"GET",
url,
headers=headers
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 30, 2023

Hi @Sudharsan S and welcome to the community!

An app password cannot be used by itself for authentication, like an OAuth access token. It needs to be used in combination with your Bitbucket account's username. You can find your username here https://bitbucket.org/account/settings/ after you log in to your account.

With curl, for example, you can use it as follows:

curl -u BitbucketUsername:AppPassword -X GET -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/workspace-id?role=member

Or with a basic auth header, where b64string is BitbucketUsername:AppPassword encoded in base64

curl -X GET -H "Authorization: Basic b64string" -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/workspace-id?role=member

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events