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
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
Hi everyone, I am new here. So it might be the case that I am missing something. It would be of great help if someone could guide me through the process. I wrote the following python code to try and get a list of all the users associated with my organization:
from atlassian import Bitbucket
self.username = "admin"
self.app_password = os.environ.get('BITBUCKET_APP_PASSWORD')
self.bitbucket = Bitbucket(
response = self.bitbucket.get_users()
I have created the BITBUCKET_APP_PASSWORD for an admin account and have granted it literally all the permissions. Bit when I try to run the `getVendorData` method I get:
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://bitbucket.org/rest/api/1.0/use
Note: The app I am working on is still in a testing phase so I am using a free Bitbucket test workspace.
Thank you for your time
I think that the problem is not with the permissions, but your code can't authenticated using the given username and password.
Hello @Ishita Chauhan ,
Welcome to Atlassian Community!
From the logs you have shared seems like this library is trying to use Bitbucket API v1.0 endpoints, which were deprecated a few years ago (see Users endpoint 1.0).
In this case, you would need to use the endpoints available in Bitbucket API v2.0. If your goal is to list all the members within a workspace, the following 2.0 endpoint might be of help :
You can also check all the other available endpoints in the Bitbucket API 2.0 Reference documentation.
Also, I see that in your script you are using the username "admin". The username used in the authentication must be the same username of the account under which you created the app password. You can check the username of your account on the website by clicking on your personal avatar in the top right corner, selecting Personal Settings, and looking for the field Username. This should be the username used in your script.
Hope that helps! Let me know in case you have any questions.
Thank you, @Ishita Chauhan !