Monitoring APIs
Reporting APIs
Reporting queries can be used to fetch data from reports, for all counters under a specific group, or for a specific counter.
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 the value of a specific counter from a counter group, with the device name and type.
Sample Request
GET /esa/api/v2.0/reporting/mail_incoming_traffic_summary/detected_amp?
startDate=2016-09-10T19:00:00.000Z&endDate=2018-09-24T23:00:00.000Z
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: esa.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 15:58:29 GMT
Content-type: application/json
Content-Length: 96
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": "detected_amp",
"resultSet": {
"detected_amp": 11}
}
}
Retrieving Multiple Values for a Counter
This example shows a query to retrieve values of all counters of a counter group, with the device group name and device type.
Sample Request
GET /esa/api/v2.0/reporting/mail_incoming_traffic_summary?startDate=2016
-09-10T19:00:00.000Z&endDate=2018-09-24T23:00:00.000Z&device_type=esa
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: esa.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 17:39:34 GMT
Content-type: application/json
Content-Length: 580
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_traffic_summary",
"resultSet": [{"verif_decrypt_success":5},
{"detected_virus": 13},
{"verif_decrypt_fail": 5},
{"threat_content_filter": 10},
{"total_graymail_recipients": 9},
{"blocked_invalid_recipient": 2},
{"ims_spam_increment_over_case": 0},
{"blocked_dmarc": 0},
{"marketing_mail": 6},
{"detected_amp": 2},
{"bulk_mail": 2},
{"total_recipients": 159},
{"social_mail": 1},
{"detected_spam": 30},
{"total_clean_recipients": 83},
{"malicious_url": 6},
{"total_threat_recipients": 67},
{"blocked_reputation": 10}]}}
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 order, device type and top parameters.
Sample Request
GET /esa/api/v2.0/reporting/mail_content_filter_incoming/recipients
_matched?startDate=2017-09-10T19:00:00.000Z&endDate=2018-09-24T23:00:00.000Z&device_type
=esa&orderDir=desc&orderBy=recipients_matched&top=2
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: esa.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:17:29 GMT
Content-type: application/json
Content-Length: 153
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": "recipients_matched",
"resultSet": {
"recipients_matched": [
{"url_rep_neutral": 16},
{"url_category": 8}
]
}
}
}
Retrieving Multiple Values for Multiple Counters
This example shows a query to retrieve multiple values for multiple counters, with offset, limit and device type parameters.
Sample Request
GET /esa/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: esa.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 multiple values for each counter), with filtering, and query type parameters. The graph attribute retrieves time based counter values of counters.
Sample Request
GET /esa/api/v2.0/reporting/mail_incoming_ip_hostname_detail?startDate=
2017-09-10T19:00:00.000Z&endDate=2018-09-24T23:00:00.000Z&device_type=esa&filterBy
=ip_address&filterOperator=begins_with&filterValue=10&query_type=graph
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46aXJvbnBvcnQ=
User-Agent: curl/7.54.0
Accept: */*
Host: esa.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:49:42 GMT
Content-type: application/json
Content-Length: 74110
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_ip_hostname_detail",
"resultSet": {
"dns_verified": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 2},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 1},
...
...
{"2018-09-01T00:00:00.000Z to 2018-09-30T23:59:00.000Z": 1}
],
"10.76.71.211": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 1},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 3},
...
...
{"2017-11-01T00:00:00.000Z to 2017-11-30T23:59:00.000Z": 1},
{"2017-12-01T00:00:00.000Z to 2017-12-31T23:59:00.000Z": 0}
],
},
{
"2018-09-01T00:00:00.000Z to 2018-09-30T23:59:00.000Z": 0
}
]
},
"last_sender_group": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 4},
{"2018-08-01T00:00:00.000Z to 2018-08-31T23:59:00.000Z": 0},
}
],
"10.76.71.211": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 2},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 2},
}
]
},
"total_threat_recipients": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 2},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 20},
...
...
{"2018-08-01T00:00:00.000Z to 2018-08-31T23:59:00.000Z": 0},
}
]
},
"threat_content_filter": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 0},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 1},
...
...
}
]
},
"total_graymail_recipients": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 0},
{"2017-10-01T00:00:00.000Z to 2017-10-31T23:59:00.000Z": 4},
...
...
{"2018-08-01T00:00:00.000Z to 2018-08-31T23:59:00.000Z": 0},
{"2018-09-01T00:00:00.000Z to 2018-09-30T23:59:00.000Z": 0}
]
},
"total_clean_recipients": {
"10.76.68.103": [
{"2018-08-01T00:00:00.000Z to 2018-08-31T23:59:00.000Z": 5},
{"2018-09-01T00:00:00.000Z to 2018-09-30T23:59:00.000Z": 0}
]
},
"sbrs_score": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 3},
...
...
{"2018-08-01T00:00:00.000Z to 2018-08-31T23:59:00.000Z": 0},
{"2018-09-01T00:00:00.000Z to 2018-09-30T23:59:00.000Z": 0}
]
},
"blocked_reputation": {
"10.76.68.103": [
{"2017-09-01T00:00:00.000Z to 2017-09-30T23:59:00.000Z": 0},
]
}
}
}
}
Schedule and Archive APIs
Schedule APIs
Synopsis |
|
|
Supported Resource Attributes |
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.
|
|
Device |
|
|
Request Headers |
Host, Accept, Authorization |
|
Response Headers |
Content-Type, Content-Length, Connection |
Examples
The following are some examples for the types of schedule reports queries:
Retrieving Scheduling Reports
The following example shows how to retrieve a list of top 25 scheduled report entries sorted based on the a selected scheduling option in descending order.
Sample Request
GET /sma/api/v2.0/config/periodic_reports?device_type=sma&
limit=25&offset=0&orderBy=periodic_report_next_run_date&orderDir=desc
HTTP/1.1
cache-control: no-cache
Postman-Token: 0f917f72-82a4-4b6d-93a9-a1fbd3e72b1b
Authorization: Basic YWRtaW46Q2lzY29AMTIzNA==
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: 10.8.159.22:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 12:14:13 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 1797
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data":
{
"periodic_reports": [{"20191120061727_Content Filters_calendar_week": {"periodic_report_type": "phoebe",
"periodic_report_schedule": {"periodic_report_second": 0, "periodic_report_day": "",
"periodic_report_month": "", "periodic_report_minute": 0, "periodic_report_weekday": "",
"periodic_report_year": "", "periodic_report_hour": 0, "periodic_report_schedule_type": "Daily"},
"periodic_report_options": {"periodic_report_format": "PDF", "periodic_report_time_range":
"Previous 7 calendar days", "periodic_report_lang": "en-us"}, "periodic_report_user_name": "admin",
"periodic_report_product_type": "ESA", "periodic_report_type_name": "Content Filters",
"periodic_report_delivery": "Archived Only", "periodic_report_recipients": [], "periodic_report_tier":
"All Email Appliances", "periodic_report_next_run_date": "21 Nov 2019 00:00 (GMT)", "periodic_report_title":
"Content Filters"}}, {"20191120060917_Content Filters_calendar_month": {"periodic_report_type": "phoebe",
"periodic_report_schedule": {"periodic_report_second": 0, "periodic_report_day": "",
"periodic_report_month": "", "periodic_report_minute": 0, "periodic_report_weekday": "",
"periodic_report_year": "", "periodic_report_hour": 0, "periodic_report_schedule_type": "Daily"},
"periodic_report_options": {"periodic_report_format": "PDF", "periodic_report_time_range":
"Previous 12 calendar months", "periodic_report_lang": "en-us"}, "periodic_report_user_name": "admin",
"periodic_report_product_type": "ESA", "periodic_report_type_name": "Content Filters",
"periodic_report_delivery": "Archived Only", "periodic_report_recipients": [], "periodic_report_tier":
"All Email Appliances", "periodic_report_next_run_date": "21 Nov 2019 00:00 (GMT)",
"periodic_report_title": "Content Filters"}}], "meta": {"totalCount": 2}
}
}
Retrieving the Details of a Schedule Report Entry
The following example shows how to retrieve a list of top 25 archived reports filtered based on the report title and sorted based on the time range of the report generation in descending order.
Sample Request
GET /sma/api/v2.0/config/archived_reports?device_type=sma&filterByTitle
=Content+Filters&limit=25&offset=0&orderBy=periodic_report_generated&orderDir=desc
HTTP/1.1
cache-control: no-cache
Postman-Token: 379beccc-d9de-4cd0-a730-69e59385bf90
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 14:00:17 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 441
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data": {
"meta": {
"totalCount": 1
},
"archived_reports": [{"20191120134501_Content Filters_calendar_month.pdf": {"periodic_report_format":
"PDF", "periodic_report_type_name": "Content Filters", "periodic_report_generated":
"20 Nov 2019 13:45 (GMT)", "periodic_report_time_range": "Previous calendar month",
"periodic_report_tier": "All Email Appliances", "periodic_report_title": "Content Filters",
"periodic_report_product_type": "esa"}}]
}
}
Viewing the Details of a Schedule Report Entry
The following example shows how to retrieve a preview PDF document for the scheduled report entry for a particular report type and time range of the report.
Sample Request
GET /sma/api/v2.0/config/archived_reports/preview?device_type=
sma&periodic_report_type_name=Outgoing%20Destinations&periodic_report_type=
phoebe&periodic_report_start_date=2017-03-01T15:00:00.000Z&periodic_report_
end_date=2019-07-30T15:00:00.000Z&periodic_report_format=pdf&periodic_report_lang=
en-us&periodic_report_time_range=Custom%20range&periodic_report_rows=
10&periodic_report_sort_columns=%7B%22table%22:%20%22Outgoing%20Destinations
%20Detail%22,%22column%22:%20%22Total%20Processed%22%7D
HTTP/1.1
cache-control: no-cache
Postman-Token: fc05953b-1552-47ab-be49-4cb2be5fc7c0
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: m680q08.ibqa.sgg.cisco.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Thu, 21 Nov 2019 17:38:08 GMT
Content-type: application/pdf
Content-Disposition: filename="20191121173808_Outgoing Destinations.pdf"
Content-Length: 111240
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email,
portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
%PDF-1.4
.....
.....
%%EOF
Adding a Scheduled Report Entry
The following example shows how to add a scheduled report with report type, report title, device type and other options.
Sample Request
POST /sma/api/v2.0/config/periodic_reports?device_type=sma
HTTP/1.1
cache-control: no-cache
Postman-Token: 9bc82e3c-b163-4558-923a-f5c03d40a332
Authorization: Basic YWRtaW46Q2lzY29AMTIzNA==
Content-Type: text/plain
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: 10.8.159.22:6080
accept-encoding: gzip, deflate
content-length: 509
Connection: keep-alive
{
"data":
{
"periodic_reports":[{"periodic_report_title":"Content Filters","periodic_report_type":"phoebe",
"periodic_report_type_name":"Content Filters","periodic_report_options":{"periodic_report_format":
"pdf","periodic_report_lang":"en-us","periodic_report_time_range":"Previous 7 calendar days"},
"periodic_report_schedule":{"periodic_report_schedule_type":"daily","periodic_report_minute":0,
"periodic_report_hour":0},"periodic_report_tier":"All Email Appliances","periodic_report_delivery":
"Archived Only"}]
}
}
Sample Response
HTTP/1.1 201 Created
Server: API/2.0
Date: Wed, 20 Nov 2019 13:17:31 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 49
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data": "Scheduled Report created Successfully"
}
Editing a Scheduled Report Entry
The following example shows how to modify a scheduled report with a schedule report ID.
Sample Request
PUT /sma/api/v2.0/config/periodic_reports/20191120133634_
Content%20Filters_calendar_week?device_type=sma
HTTP/1.1
cache-control: no-cache
Postman-Token: 7adc6d87-64bd-40d5-827a-3e5d2ea8406b
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Content-Type: text/plain
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
content-length: 510
Connection: keep-alive
{
"data":
{
"periodic_reports":[{"periodic_report_title":"Content Filters","periodic_report_type":
"phoebe","periodic_report_type_name":"Content Filters","periodic_report_options":
{"periodic_report_format":"pdf","periodic_report_lang":"en-us","periodic_report_time_range":
"Previous calendar month"},"periodic_report_schedule":{"periodic_report_schedule_type":"daily",
"periodic_report_minute":45,"periodic_report_hour":13},"periodic_report_tier":
"All Email Appliances","periodic_report_delivery":"Archived Only"}]
}
}
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 13:44:35 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 49
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data": "Scheduled Report Updated Successfully"
}
Deleting Scheduled Reports
The following example shows how to delete a scheduled report with device type and a schedule report ID.
Sample Request
DELETE /sma/api/v2.0/config/periodic_reports?device_type=sma&
id=20191120135041_Advanced+Malware+Protection+File+Analysis_calendar_week
HTTP/1.1
cache-control: no-cache
Postman-Token: 74cf4ad5-ff0f-4173-894e-a0c2a9c3d6d5
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
content-length: 0
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 13:54:49 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 52
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data":
{
"message": "1 item deleted successfully"
}
}
Archive APIs
Synopsis |
|
|
Supported Resource Attributes |
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.
|
|
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
The following are some examples for the types of archived reports queries:
Searching Archived Reports
The following example shows how to search for a list of top 25 archived reports based on the report title and sorted by the date and time the report is generated, in descending order.
Sample Request
GET /sma/api/v2.0/config/archived_reports?device_type=
sma&filterByTitle=content&limit=25&offset=0&orderBy=periodic_
report_generated&orderDir=desc
HTTP/1.1
cache-control: no-cache
Postman-Token: fc26a46d-52f0-410c-ba9a-5a896a8aa691
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 14:20:37 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 441
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data":
{
"meta":
{
"totalCount": 1
},
"archived_reports": [{"20191120134501_Content Filters_calendar_month.pdf":
{"periodic_report_format": "PDF", "periodic_report_type_name": "Content Filters",
"periodic_report_generated": "20 Nov 2019 13:45 (GMT)", "periodic_report_time_range":
"Previous calendar month", "periodic_report_tier": "All Email Appliances",
"periodic_report_title": "Content Filters", "periodic_report_product_type": "esa"}}]
}
}
Retrieving Archived Reports
The following example shows how to retrieve a list of top 25 archived reports sorted by the time range of the report in descending order.
Sample Request
GET /sma/api/v2.0/config/archived_reports?device_type=sma&limit=25
&offset=0&orderBy=periodic_report_generated&orderDir=desc
HTTP/1.1
cache-control: no-cache
Postman-Token: 2adbdec2-ef46-4c7e-abf2-9f06cd52a0d7
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 14:04:02 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 441
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data": {
"meta": {
"totalCount": 1
},
"archived_reports": [{"20191120134501_Content Filters_calendar_month.pdf": {"periodic_report_format":
"PDF", "periodic_report_type_name": "Content Filters", "periodic_report_generated":
"20 Nov 2019 13:45 (GMT)", "periodic_report_time_range": "Previous calendar month", "periodic_report_tier":
"All Email Appliances", "periodic_report_title": "Content Filters", "periodic_report_product_type": "esa"}}]
}
}
Retrieving the Details of a Archive Report Entry
The following example shows how to retrieve an archived report entry with device type and an archived report ID.
Sample Request
GET /sma/api/v2.0/config/archived_reports/view/20191120134501_Content
%20Filters_calendar_month.pdf?device_type=sma
HTTP/1.1
cache-control: no-cache
Postman-Token: 86b684cc-7721-4fa9-8012-2077d45582a5
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 14:06:40 GMT
Content-type: application/pdf
Content-Disposition: filename="20191120134501_Content Filters_calendar_month.pdf"
Content-Length: 111141
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
%PDF-1.4
.......
.......
%%EOF
Viewing the Details of a Archived Report Entry
The following example shows how to retrieve a preview PDF document for an archived report entry for a particular report type and time range of the report.
Sample Request
GET /sma/api/v2.0/config/archived_reports/preview?device_type=sma
&periodic_report_type_name=Outgoing%20Destinations&periodic_report_type=phoebe
&periodic_report_start_date=2017-03-01T15:00:00.000Z&periodic_report_end_date=
2019-07-30T15:00:00.000Z&periodic_report_format=pdf&periodic_report_lang=en-us
&periodic_report_time_range=Custom%20range&periodic_report_rows=10
&periodic_report_sort_columns=%7B%22table%22:%20%22Outgoing%20Destinations
%20Detail%22,%22column%22:%20%22Total%20Processed%22%7D
HTTP/1.1
cache-control: no-cache
Postman-Token: fc05953b-1552-47ab-be49-4cb2be5fc7c0
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: m680q08.ibqa.sgg.cisco.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Thu, 21 Nov 2019 17:38:08 GMT
Content-type: application/pdf
Content-Disposition: filename="20191121173808_Outgoing Destinations.pdf"
Content-Length: 111240
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email,
portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
%PDF-1.4
.....
.....
%%EOF
Adding an Archive Report Entry
The following example shows how to add an archived report with report title, report type, device type and other options.
Sample Request
POST /sma/api/v2.0/config/archived_reports?device_type=sma
HTTP/1.1
cache-control: no-cache
Postman-Token: 83c60ea4-e187-41bd-9e13-cacbdf43967a
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Content-Type: text/plain
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
content-length: 545
Connection: keep-alive
{
"data":
{
"archived_reports":[{"periodic_report_title":"Connections by Country","periodic_report_type":
"phoebe","periodic_report_type_name":"Connections by Country","periodic_report_options":
{"periodic_report_format":"pdf","periodic_report_lang":"en-us","periodic_report_time_range":
"Previous 7 calendar days","periodic_report_rows":10,"periodic_report_sort_columns":[{"table":
"Total Incoming Mail Connections by Country","column":"Total Connections"}]},
"periodic_report_tier":"All Email Appliances","periodic_report_delivery":"Archived Only"}]
}
}
Sample Response
HTTP/1.1 201 Created
Server: API/2.0
Date: Wed, 20 Nov 2019 14:11:44 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 46
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data":
{
"message": "Archived successfully"
}
}
Deleting an Archived Report Entry
The following example shows how to delete an archived report with device type and an archived report ID.
Sample Request
DELETE /sma/api/v2.0/config/archived_reports?device_type=sma&
id=20191120141701_Connections+by+Country_calendar_week.pdf
HTTP/1.1
cache-control: no-cache
Postman-Token: affe27d3-d8bc-4986-a826-e9a6f449ac80
Authorization: Basic YWRtaW46Q2lzY28xMjMk
User-Agent: PostmanRuntime/7.6.0
Accept: */*
Host: sma.cisco:6080
accept-encoding: gzip, deflate
content-length: 0
Connection: keep-alive
Sample Response
HTTP/1.1 200 OK
Server: API/2.0
Date: Wed, 20 Nov 2019 14:17:40 GMT
Cache-control: no-store
Pragma: no-cache
Content-type: application/json; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 52
Connection: close
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: content-type, jwttoken, mid, h, email, portal, cache-control, pragma
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Expose-Headers: Content-Disposition, jwtToken
{
"data":
{
"message": "1 item deleted successfully"
}
}