hello!
when I use bitbucket rest api like https://api.bitbucket.org/2.0/repositories/{workspace}/ to get repositories, the return status code is 403 and content is 'b'Too many invalid password attempts. Log in at https://id.atlassian.com/ to restore access.\n''.
But my username and password is right , I can use them login https://id.atlassian.com/ through broswer.
I use python package requests do my request, the code like this:
from requests.auth import HTTPBasicAuth
import requests
username = "{username}"
password = "{password}"
email = "{email}"
worksapce = "{worksapce}"
BITBUCKET_URL = "https://api.bitbucket.org/2.0"
BITBUCKET_AUTH = HTTPBasicAuth(username, password)
BITBUCKET_HEADERS = {"content-type": "application/json"}
response = requests.get(f"https://api.bitbucket.org/2.0/repositories/{worksapce}/",
params={
"pagelen": 100
},
auth=BITBUCKET_AUTH,
headers=BITBUCKET_HEADERS)
print(response.status_code)
print(response.content)
print(response.json())
please help me! Any help would be highly appreciated.
Thanks in advance!
Hey Yue!
Thank you for your help! Your second resolution can work, first not!
Thank you again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.