I need to setup some environment variables and queue the last successful version for deployment using a python script.
I'm doing something like this to get the last deployed versionId:
url = f"{base_url}/rest/api/latest/deploy/environment/{environment_id}/results"
headers = {"Accept": "application/json"}
response = requests.request("GET", url, auth=(username, password), headers=headers)
response = json.loads(response.text)
return response["results"][0]["deploymentVersion"]["id"]
Hello Madhankumar M,
Welcome to Atlassian community
I think probably the authentication is not coming correctly via Insomnia. Just to double check can you try to access this API via Postman and check if you are getting the same error?
Regards,
Shashank Kumar
Hi @Shashank Kumar,
Thanks for the reply. I tried using postman too. Same response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Madhu,
What errors do you see in <bamboo-home>logs>atlassian-bamboo.log file when you use the REST API from postman, does it print anything different from 401 error?
Regards,
Shashank Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey, I think I got what the issue is.
Sometimes when I login, bamboo asks for a captcha verification. Whenever that happens, I'm getting the 401 error while using the REST API. Once I login to the UI after completing the captcha verification, the API requests are going through.
Is there a way to bypass captcha while accessing the REST API?
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.