Get Site Status report data for all or the specified monitors.
The report-sitestatus
operation is similar to the sitestatus
Report API operation, but it has different parameters that allow you to get the Site Status report for certain monitors or monitor types, sub-account monitors, and filter out the report data. See the operation parameters for details.
Request URL
GET https://api.alertsite.com/api/v3/report-sitestatus[?parameters]
Authentication
The request must include the Authorization
header containing a user’s access token:
Authorization: Bearer ACCESS_TOKEN
See Authentication for more information.
Parameters
Query parameters are optional, but can be used to filter the returned data.
monitors
The ID of the monitor to get or a comma-separated list of monitor IDs. If neither monitors
nor monitor_groups
are specified, all monitors are returned.
The monitors
and monitor_groups
parameters are not cumulative. This means that if you specify both parameters, the report will include only those monitors that belong to the specified monitor groups. If a monitor is in multiple monitor groups, it will be included in the report as many times as many groups it is in.
To learn where to find a monitor ID, see Monitor IDs.
monitor_groups
The ID of the monitor group to get or a comma-separated list of monitor group IDs. If neither monitors
nor monitor_groups
are specified, all monitors are returned.
Tip: | To learn the monitor group ID, click Compare on the AlertSite UXM Dashboard, switch to the Config tab, select the needed monitor group, and see the Id column. |
type
The type of the monitors to get or a comma-separated list of monitor types. By default, all monitor types are included in the report.
Accepted values:
Value | Monitor Type |
---|---|
|
|
|
|
|
Real-browser or mobile web monitor (DéjàClick) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Web URL monitor for https:// URLs |
|
API endpoint monitor for https:// endpoints |
summarize
Boolean. If set to true
, it returns one report per monitor. If set to false
(the default value), it shows results per monitor locations and includes information about the locations. See below for details.
shownotes
Boolean. Includes the monitor note status: whether it exists and has been seen. See note_exists
and note_seen
for details. The default value is false
.
onlyerrors
Boolean. If set to true
, it shows monitors only in the error status. The default value is false
.
Note: | The onlyerrors and onlyok parameters are mutually exclusive. |
onlyok
Boolean. If set to true
, it shows monitors only in the OK status. The default value is false
.
Note: | The onlyerrors and onlyok parameters are mutually exclusive. |
enabledonly
Boolean. It shows only enabled monitors. The default value is false
.
showsubaccounts
Boolean. This parameter applies only to accounts with subaccounts. If set to true
, it shows monitors of the master account, as well as monitors of all subaccounts. The default value is false
.
sub_accounts
This parameter applies only to accounts with subaccounts. The IDs of subaccounts or a comma-separated list of subaccount IDs whose monitor data you want to get. Use this parameter together with the showsubaccounts
parameter set to true
.
If you use this parameter together with the monitor
or monitor_groups
parameters, this will return reports for the specified monitors or monitor groups that belong to the specified subaccount. Other monitors of the specified subaccounts will not be included in the report.
Tip: | You can learn the sub-account ID under the Select a view menu in the Subaccounts section. See Filters and Views for details. |
select
String. A comma-separated list of report data fields to return in the response. The field names are case-sensitive. Unrecognized field names are ignored.
If this parameter is omitted, all fields are included. Note that select=
with an empty value is not the same as an omitted parameter, and means no fields will be returned.
For more information, see Filter response fields.
Response body
On success, the operation returns HTTP status 200 and a JSON representation of the Site Status report.
{
"metadata": {
"__permissions": {
"acl": 7
},
"resultset": {
"count": 1,
"limit": null,
"offset": null
}
},
"results": [
{
"device_name": "Amazon sign in",
"device_type": "DejaClick",
"dt_last_error": "2019-06-19 03:30:52",
"dt_last_status": "2019-06-19 03:30:52",
"info_msg": "Timeout interval reached waiting for an expected URL location change event. Replay stopped.",
"last_status": "84",
"last_status_desc": "Location change timeout",
"monitor": "y",
"monitor_browser_description": "Google Chrome",
"monitor_interval": "5",
"monitor_type": "dejaclick",
"obj_cust": "35531",
"obj_device": "623862",
"obj_devlog": "7580165",
"resptime_last": "1.3790650367736816"
}
]
}
A response body may include the following fields:
Value | Description |
---|---|
|
The monitor name. |
|
The monitor type (see below). |
|
The date and time when the last error was detected. |
|
The date and time of the latest monitor run. |
|
Optional additional error data. |
|
The AlertSite status code of the latest monitor run. |
|
A short description of the last AlertSite status code. |
|
The geographical coordinates of the location. |
|
The location name. |
|
The geographical coordinates of the location. |
|
|
|
The browser that is used to access the website being monitored. The field is returned only for DéjàClick monitors. Possible values: |
|
A short description of the monitor group. |
|
The monitor group ID. |
|
How often the monitor checks your website. |
|
The monitor type (see below). |
|
Shows whether a monitor note exists for the monitor:
|
|
Shows whether a monitor note has been seen:
|
|
The customer ID without the leading |
|
The monitor ID. |
|
Reserved for internal use. |
|
The location ID or a comma-separated list of location IDs. See here for the IDs of public AlertSite locations. |
|
The response time during the latest test. |
Below are possible values of the device_type
and monitor_type
fields:
device_type |
monitor_type |
Description |
---|---|---|
SoapUI API |
api |
|
BitBar |
bitbar |
|
DejaClick |
dejaclick |
Real-browser or mobile web monitor (DéjàClick) |
Email IMAP |
email-imap |
|
Email POP |
email-pop |
|
Email Roundtrip |
email-round-trip |
|
Email SMTP |
email-smtp |
|
FTP Server |
ftp |
|
Secure FTP Server |
ftp-ssl |
|
Name Server |
name-server |
|
Ping |
ping |
|
Selenium Script |
selenium |
|
ServerAgent |
serveragent |
|
Simple TCP Connect |
tcp |
|
Transaction |
transaction |
|
Secure Transaction |
transaction-ssl |
|
Web Site |
website |
|
Web Site API |
website-api |
|
Secure Web Site |
website-ssl |
Web URL monitor for https:// URLs |
Secure Web Site API |
website-ssl-api |
API endpoint monitor for https:// endpoints |
Error responses have a non-200 status and include the errors
list:
{
"errors": [
{
"code": 400,
"message": "Invalid type filter provided: website-monitor"
}
]
}
Try it out
Click here to test this operation in the AlertSite interactive API console.
Code examples
cURL
Get the Site Status report for all monitors:
curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus' -H 'Authorization: Bearer ACCESS_TOKEN'
Get the Site Status report for monitor ID 150610 and 149098:
curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?monitors=150610,C149098' -H 'Authorization: Bearer ACCESS_TOKEN'
Get the Site Status report for SoapUI and API endpoint monitors:
curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?type=api,website-api' -H 'Authorization: Bearer ACCESS_TOKEN'
Get the Site Status report for all monitors in error:
curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?onlyerrors=true' -H 'Authorization: Bearer ACCESS_TOKEN'
Get the Site Status report for all monitors but include only the monitor name and type, last run status and its description, and the last response time:
curl -X GET 'https://api.alertsite.com/api/v3/report-sitestatus?select=device_name,monitor_type,last_status,last_status_desc,resptime_last' -H 'Authorization: Bearer ACCESS_TOKEN'
Python
Python
import requests # Requests library – http://docs.python-requests.org/
import pandas # Pandas library – https://pandas.pydata.org/
import json
baseUrl = 'https://api.alertsite.com/api/v3'
username = '[email protected]' # Replace with your AlertSite login email
password = 'pa55w0rd' # Replace with your AlertSite password
# Log in
payload = {'username': username, 'password': password}
r = requests.post(baseUrl + '/access-tokens', data=json.dumps(payload), headers={'Content-Type': 'application/json'})
token = r.json()['access_token']
r = requests.get(baseUrl + '/report-sitestatus', headers={'Authorization': 'Bearer ' + token})
result = r.json()
if r.status_code == requests.codes.ok:
# Use Pandas to output the report as a table
data_frame = pandas.DataFrame(result['results'], columns=['obj_device', 'device_name', 'dt_last_status', 'last_status', 'resptime_last'])
# Truncate monitor names and response time to fit the display
data_frame['device_name'] = data_frame['device_name'].str[:20]
data_frame['resptime_last'] = data_frame['resptime_last'].str[:6]
with pandas.option_context('display.max_rows', None, 'display.max_columns', None, 'display.width', 120):
print(data_frame)
else:
print('Could not get the Site Status report. The following error(s) occurred:', *result['errors'], sep='\n')