Home / Supported Actions / Last x downtimes

Last x downtimes


This API can be used to get the last 'x' downtimes of all the monitors, where x denotes a number.

Request URL

Below is a sample request  for viewing all downtimes for all the monitors:

http://site24x7.com/api/xml/downtimeslist?apikey=[APIKEY]

For example,

http://site24x7.com/api/xml/downtimeslist?apikey=f98394a9538975fe3ba18e1501e3ecb1

If you want to view only the last 2 downtimes, use the below request:

http://site24x7.com/api/xml/downtimeslist/2?apikey=f98394a9538975fe3ba18e1501e3ecb1

Sample Success Response

Below is a sample success response in XML format. This shows the last couple of downtimes for' MyMonitor'. The MyCorporate monitor has no downtimes, hence they are not listed.

<response uri="/api/xml/downtimeslist" action="DowntimesList">
<result>
<response>
<group name="me">
<monitor displayname="MyCorporate" monitortype="URL"/>
<monitor displayname="MyMonitor" monitortype="URL">
<downtime duration="1 days 0 Hrs 21 Mins " downtime="April 20, 2009 3:41 PM IST" uptime="April 20, 2009 3:41 PM IST"/>
<downtime duration="2 Mins 7 Secs" downtime="April 20, 2009 3:24 PM IST" uptime="April 20, 2009 3:24 PM IST"/>
</monitor>
</group>
</response>
</result>
</response>

Errors

Listing the last 'x' downtimes of monitors might return some errors depending on the parameters specified. Below is a sample response if the url is incorrect.

<response uri="/api/xml/downtimeslis">
<error>
<code>2891</code>
<message>The specified request URI is incorrect</message>
</error>
</response>











     RSS of this page