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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Having issues with app password working with a Python script

Edited

Hello,

I am getting a 401 error when using an app password in my python script.  The script works with my username:password but not with username:appPassword.  The app password works when making the same api call in postman.  I am using Python 3.9.0. 

Note: I have also tried giving the app pw all possible permissions and still getting a 401 when using the app pw.

api call

headers = {'Content-Type''application/json ; charset=utf-8')

url = 'https://bitbucket.org/!api/2.0/repositories/{}/{}/commits'.format(campus, student_repo_name) 

call_student_repo = requests.get(url, auth('USERNAME''APPPASSWORD'), headers=headers) 

student_repo = call_student_repo.json()['values']

 

This script will be called with a Pipeline so if there is an alternative way to use the credentials in that for the api call I would be happy to explore that as well. 

Thanks

1 answer

Hi @Steven Pennington 

Have you tried using your email address instead of username?

Still getting a 401 when running the script. When using email on postman I am now getting a 401 there as well. 

Hey @Steven Pennington 

You might want to consider using this API wrapper  for easy usability.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,826 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you