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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You might want to consider using this API wrapper for easy usability.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.