Skip to main content
Question

Automation Anywhere Historical Activity API Request


Hi everyone,

 

is it possible to fetch Historical Data from your control room via API?

Basically everything what is stored in http://<my-control-room/#/activity/historical

 

Thanks a lot!

 

8 replies

Tamil Arasu10
Most Valuable Pathfinder
Forum|alt.badge.img+7

https://community.cloud.automationanywhere.digital/swagger//p>

 

You can get details from the Audit Logs section.


Forum|alt.badge.img+11

Forum|alt.badge.img+11

Can you try the same in POSTMAN and check? Status Code 200 is Success case.


  • Author
  • Cadet | Tier 2
  • March 15, 2022

Hello Chandu, thanks for your response

 

I already tried the Audit API Approch. However, all I get is an empty list as a response. Could you maybe tell me, what I'm doing wrong?

 

This is what my python code looks like:

 

--------------------------------------------------------------------------------

audit_url = "<my_control_room_url>/v1/audit/messages/list"

headers = {

'accept': 'application/json',

'X-Authorization': <my_access_tokenl>,

'Content-Type': 'application/json',

}

 

data = '{ "username": "myusername", "password": "mypassword"}'

 

response = requests.post(audit_url, headers=headers, data=data)

--------------------------------------------------------------------------------

 

And this is what I get as a response from the server:

 

--------------------------------------------------------------------------------

Status code: 200

{

 "page": {

  "offset": 0,

  "total": 227189,

  "totalFilter": 10000

 },

 "list": []

}

-------------------------------------------------------------------------------

 

As you can see, the list is empty, even though I put no filter on my request.

 

Thanks in Advance

 


  • Navigator | Tier 3
  • March 16, 2022

we can get it


  • Author
  • Cadet | Tier 2
  • March 16, 2022

Yes I will try it via POSTMAN and give an update :)

Thank you for your help


  • Author
  • Cadet | Tier 2
  • March 16, 2022

Are you using Python aswell? If so, may I see your code snippet for the request part including header and body. Maybe I'm overseeing something.


{

"sort":

[

{

"field": "createdOn",

"direction": "desc"

}

],

 

"filter":{

"operator":"and",

"operands":[

{"operator": "eq",

"field": "status",

"value": "Unsuccessful"

},

{"operator": "gt",

"field": "createdOn",

"value": StartTime

},

{"operator": "lt",

"field": "createdOn",

"value": EndTime

}

]

},

"page":{

"offset":0,

"length":10000

}

}

 

This is how my json along with filter looks like post authenticating to CR