cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1487
Views
0
Helpful
2
Replies

Reporting ASyncOS calls for ESA

akodisinghe
Level 1
Level 1

Hi!

I'm fairly new in this space. I'm trying to call the ASyncOS API to get a list of "Top Senders by Clean Messages". Just like how you'd see in the esa web portal (as a chart).

 

Would you please let me know what the uri I should be using and the parameters I should be specifying?

For test purposes I was trying something like this in Fiddler, but I was getting an error (Partial URL cannot be processed). I did have the required headers included in the GET call.

https://<esa:port>/sma/api/v2.0/reporting/mail_incoming_ip_hostname_detail?startDate=2020-10-10T19:00:00.000Z&endDate=2020-10-24T23:00:00.000Z&device_type=esa&filterBy=ip_address&filterOperator=begins_with&filterValue=10&query_type=graph

 

Any help is much appreciated!

Thanks,

Arjuna

 

2 Replies 2

anjalik
Cisco Employee
Cisco Employee

Hi Arjuna,

 

The below link contains various samples strings of the GET requests :

https://www.cisco.com/c/en/us/td/docs/security/security_management/sma/sma12-0/api/b_SMA_API_12/test_chapter_010.html#id_67139

 

If you are still facing any issues, request you to open a TAC case.

- Anjali 

Hello Anjali,

Thanks for your response. 

Do you know why I'm always getting a 401 error (Even as an admin user), when I try making this API call? 

(Obviously my encoded Authorization credentials and the host values are different from below).

 

GET /sma/api/v2.0/config/appliances?device_type=sma 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: sma.example.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive

 

HTTP/1.0 401 Permission denied
Server: EmailAPI/1.0
Date: Tue, 20 Oct 2020 19:19:39 GMT
Content-Type: application/json
Connection: close

{"error": {"message": "Permission denied.", "code": "401", "explanation": "401 = No permission -- see authorization schemes."}}