Reporting APIs
Reporting queries can be used to fetch data from report groups, for all reports under a specific group, or for a specific report.
Synopsis |
|
|
Supported Resource Attributes |
Duration |
This is a required parameter. All API queries should be accompanied with this parameter.
Aggregate report(s) for the specified duration. |
Query Type |
|
|
Sorting |
You should use both these parameters. If you use either, you will not receive data in the response.
|
|
Lazy Loading |
You should use both these parameters. If you use either, you will not receive data in the response.
|
|
Data Retrieval Option |
|
|
Filtering |
Filter parameters restrict the data to be included the response.
|
|
Device |
|
|
Request Headers |
Host, Accept, Authorization |
|
Response Headers |
Content-Type, Content-Length, Connection |
Examples
Examples for the types of reporting queries are shown below:
Retrieving a Single Value for a Counter
This example shows a query to retrieve a single value for a counter.
Sample Request
GET /sma/api/v2.0/reporting/web_malware_category_malware_name_user_detail/
blocked_malware?startDate=2017-11-14T02:00+00:00&endDate=2018-02-18T01:00+00:00&
filterValue=23&filterBy=na&filterOperator=is&device_type=wsa
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: sma.cisco.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Mon, 26 Nov 2018 16:29:33 GMT
Content-type: application/json
Content-Length: 193
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"meta": {
"totalCount": 4
},
"data": {
"type": "blocked_malware",
"resultSet": {
"blocked_malware": [
{
"10.8.93.12": 137511
},
{
"10.8.93.20": 112554
},
{
"10.8.93.11": 92839
},
{
"10.225.98.234": 6
}
]
}
}
}
Retrieving Multiple Values for a Counter
This example shows a query to retrieve multiple values for a counter, with the order direction and device type parameters.
Sample Request
GET /sma/api/v2.0/reporting/web_services_summary?orderBy=transaction_total&
orderDir=desc&startDate=2018-08-16T18:00:00.000Z&endDate=2018-11-15T10:00:00.000Z&device_type=wsa
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: 10.8.159.21:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Sun, 18 Nov 2018 15:38:52 GMT
Content-type: application/json
Content-Length: 403
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"meta": {
"totalCount": -1
},
"data": {
"type": "web_services_summary",
"resultSet": [
{"detected_by_traffic_monitor": 0},
{"detected_malware_total": 42},
{"high_risk_transaction_total": 7109},
{"blocked_by_admin_policy": 0},
{"detected_by_amp": 0},
{"allowed_transaction_total": 26369},
{"transaction_total": 33478},
{"blocked_or_warned_by_webcat": 29},
{"blocked_by_wbrs": 7038},
{"blocked_by_avc": 0}
]
}
}
Retrieving Single Values for Each Counter in a Counter Group
A counter group may have multiple counters. This example shows a query to retrieve single values for each counter in a counter group, with the filter, device type, and top parameters.
Sample Request
GET /sma/api/v2.0/reporting/web_application_type_detail/bw_not_limited?startDate=
2017-09-10T19:00:00.000Z&endDate=2018-09-24T23:00:00.000Z&device_type=wsa&filterValue=
F&filterOperator=begins_with&filterBy=na&top=2
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: 10.8.159.21:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Sun, 18 Nov 2018 15:48:21 GMT
Content-type: application/json
Content-Length: 138
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"meta": {
"totalCount": 2
},
"data": {
"type": "bw_not_limited",
"resultSet": {
"bw_not_limited": [
{"File Sharing": 84},
{"Facebook": 42}
]
}
}
}
Retrieving Multiple Values for Multiple Counters
This example shows a query to retrieve multiple values for multiple counters, with the offset and limit, and device type parameters.
Sample Request
GET /sma/api/v2.0/reporting/mail_incoming_domain_detail?startDate=2017-09-10T19:00:00.000Z
&endDate=2018-09-24T23:00:00.000Z&device_type=esa&offset=1&limit=2
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: sma.cisco.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Sat, 17 Nov 2018 18:25:28 GMT
Content-type: application/json
Content-Length: 1934
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"meta": {
"totalCount": -1
},
"data": {
"type": "mail_incoming_domain_detail",
"resultSet": {
"conn_tls_total": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 5}
],
"conn_tls_opt_success": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 0}
],
"conn_tls_opt_fail": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 0}
],
"blocked_invalid_recipient": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 1}
],
"last_sender_group_name": [
{"pphosted.com": "UNKNOWNLIST"},
{"vm30bsd0004.ibqa": "UNKNOWNLIST"}
],
"detected_amp": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 2}
],
"social_mail": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 1}
],
"detected_spam": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 25}
],
"blocked_reputation": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 5}
],
"total_throttled_recipients": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 2}
],
"total_accepted_connections": [
{"pphosted.com": 2},
{"vm30bsd0004.ibqa": 119}
],...
...
"threat_content_filter": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 5}
],
"marketing_mail": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 5}
],
"blocked_dmarc": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 0}
],
"conn_tls_success": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 5}
],
"total_recipients": [
{"pphosted.com": 2},
{"vm30bsd0004.ibqa": 112}
],
"conn_tls_fail": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 0}
],
"total_threat_recipients": [
{"pphosted.com": 0},
{"vm30bsd0004.ibqa": 49}
]
}
}
}
Retrieving Multiple Values for Multiple Counters, with Multiple Values for Each Counter
This example shows a query to retrieve multiple values for multiple counters, with the offset and limit, and query type parameters.
Sample Request
GET /sma/api/v2.0/reporting/web_application_name_application_type_detail?startDate
=2017-08-16T18:00:00.000Z&endDate=2018-11-15T15:00:00.000Z&device_type=wsa&query_type=export
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: 10.8.159.21:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Sun, 18 Nov 2018 15:55:50 GMT
Content-type: application/json
Content-Length: 1258
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"meta": {
"totalCount": -1
},
"data": {
"type": "web_application_name_application_type_detail",
"resultSet": {
"time_intervals": [
{
"end_timestamp": 1538332199,
"counter_values": [
{
"counter_values": [
42,
25932,
0,
42,
0,
42,
0
],
"application_type": "File Sharing",
"counter_key": "4shared"
},
{
"counter_values": [
2,
109614,
0,
2,
0,
2,
0
],
"application_type": "Media",
"counter_key": "Dailymotion"
},
{
"counter_values": [
42,
20748,
0,
42,
0,
42,
0
],
"application_type": "Facebook",
"counter_key": "Facebook General"
},
{
"counter_values": [
42,
20580,
0,
42,
0,
42,
0
],
"application_type": "File Sharing",
"counter_key": "MediaFire"
},
{
"counter_values": [
229,
158838,
0,
229,
0,
229,
0
],
"application_type": "Social Networking",
"counter_key": "Twitter"
},
{
"counter_values": [
1,
86334,
0,
1,
0,
1,
0
],
"application_type": "Instant Messaging",
"counter_key": "Wechat_web"
},
{
"counter_values": [
44,
40876,
0,
44,
0,
44,
0
],
"application_type": "Media",
"counter_key": "YouTube"
}
],
"begin_timestamp": 1530383400,
"end_time": "2018-09-30T23:59:00.000Z",
"begin_time": "2018-07-01T00:00:00.000Z"
}
],
"counter_names": [
"bw_not_limited",
"bandwidth_used",
"bw_limited",
"completed_transaction_total",
"blocked_transaction_total",
"transaction_total",
"blocked_by_avc"
]
}
}
}