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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.