Skip to main content
Answer

Can't parse json for rest api

  • December 1, 2025
  • 7 replies
  • 40 views

Forum|alt.badge.img+4

 


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.

 


Postman output

 

 

Best answer by DanC25

@Aaron.Gleason 

Thanks for the remote help!

It seems the issue was related to backend metadata stored in the AA Control Room. Some configuration  may not have been properly refreshed when the bot was modified. This likely left behind dangling metadata in the DB that prevented the bot from correctly parsing and extracting JSON data.

Recreating the bot from scratch triggered a full metadata rebuild in the Control Room, and resolved the issue.

7 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • December 1, 2025

@DanC25 Have you tried without downloading the file (first screen shot, turn off download file)? You could also inspect the file you downloaded to see if it contains the correct JSON message.

Alternately, you could continue downloading the file and use the file as the source for your Json: Start session action.


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

@Aaron.Gleason 

Thanks. I tried both downloading the file and not downloading it — still the same error. Whether the “Download file” option is checked or not, I get the same result. And when I download the file, it ends up empty

does this because of the API response (postman) contains invalid JSON due to unescaped XML content within the JSON string → line 13

 

 


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

@Aaron.Gleason 

use dic and error field content must not be null

 

 

 

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • December 1, 2025

@DanC25 That message from the Message Box action just means the variable is empty, which you already know.

According to the site’s API definition, you need an access token. I’m assuming you’re using a REST request ahead of this one to get the token. You may have to call it each time to get a fresh token, depending on how picky their API is. You have 16 headers in the Postman result. I’ll bet one of those is the access token.

https://documentation.commvault.com/saas/access_tokens_for_rest_apis.html

If you want to work on this a bit more confidentially, email me directly at aaron.gleason@automationanywhere.com and maybe we can pinpoint the issue.


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

@Aaron.Gleason 

 

thanks and i just email you 


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

@Aaron.Gleason 

Thanks for the remote help!

It seems the issue was related to backend metadata stored in the AA Control Room. Some configuration  may not have been properly refreshed when the bot was modified. This likely left behind dangling metadata in the DB that prevented the bot from correctly parsing and extracting JSON data.

Recreating the bot from scratch triggered a full metadata rebuild in the Control Room, and resolved the issue.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • December 2, 2025

@DanC25 great job finding the root cause. I guess sometimes it helps to have someone trying the same thing and seeing if the error persists. 👍☺️