Skip to main content
Question

use a Bearer token in Automation Anywhere

  • December 1, 2025
  • 3 replies
  • 20 views

Forum|alt.badge.img+4

Hello Community

 

I’m building a simple bot to connect to the Commvault API and pull backup history.
I tested it with a local Python script and it works fine, but when I try to run it inside the bot, I get an error saying  <Api_GenericResp errorMessage="Access denied" errorCode="5" />

i have tried to use token with ‘insecure str’ format ‘Bearer xxxxxxx’ and still same error

What’s the correct way to use a Bearer token in Automation Anywhere?


 


sample python script and it works fine

 

import json
url = "https://m3.metallic.io/commandcenter/api/Job?completedJobLookupTime=86400&jobCategory=All"


headers = {
'Accept': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'Authorization': 'Bearer xxxx'
}

response = requests.request("GET", url, headers=headers)
print(f"Status Code: {response.status_code}\n")
print(json.dumps(response.json(), indent=2))


 


 

3 replies

Forum|alt.badge.img+4
  • Author
  • Navigator | Tier 3
  • December 1, 2025

It’s working now and the error is gone after following that thread, but the JSON in the message box is coming back empty. Any idea why?

 

 


 


Forum|alt.badge.img+4
  • Author
  • Navigator | Tier 3
  • December 1, 2025



Both the Python script and Postman work fine, but when I run it in the bot, it doesn’t return anything — the message box just comes back empty. And if I send it as a JSON session, it throws an error saying it can’t parse the input JSON.


 

 


Forum|alt.badge.img+4
  • Author
  • Navigator | Tier 3
  • December 1, 2025

The Bearer token issue is resolved — we can close this thread. I’ll open a new one for the JSON parsing problem.