You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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=(",", ": ")))
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.