Skip to main content

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!

 

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

 

You can get details from the Audit Logs section.


Hi @Emil Agamir​ ,

 

Have you explored on API Approach? checkout below link for more insights.

 

https://docs.automationanywhere.com/bundle/enterprise-v11.3/page/enterprise/topics/control-room/control-room-api/api-audit-api-fetch-audit-data.html/p>


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


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": u]

}

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

 

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

 

Thanks in Advance

 


we can get it


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

Thank you for your help


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


Reply