ServiceUptime API Documentation
Introduction
Welcome to the ServiceUptime API documentation!
ServiceUptime provides industry standard REST+JSON API. Our API supports both HTTP GET/POST requests as well as JSON objects posted using HTTP POST. JSON is returned in all responses.
API Summary
API version
- Vesion
- 1.0.1
- Last modification
- 11/21/2014
API endpoint
The API endpont contains both autotization (i.e. API Key) and method information:
http://www.serviceuptime.com/api/{API_Key}/{API_Method}/
Also you can use secured version of API:
https://www.serviceuptime.com/api/{API_Key}/{API_Method}/
API Keys
Your API Keys are available on the API Keys page on Intercom, accessible from your settings. To create a Key, you can click the 'New API Key' button on that page. Since your API keys allow privileged access it is imperative you keep them secret. API Keys can be revoked via your settings in ServiceUptime.
Common Approaches
- Data
- API data is JSON encoded with UTF-8. API JSON is either a single object or a list of objects.
- Authorization
- Access control using API Keys.
- Errors
- 4xx and 5xx responses returning JSON with error codes.
- HTTP
- Methods are used in accordance with HTTP GET or POST and resources are identified using URIs. All API requests can be sent over HTTPS as well.
Monitor Object
Common attributes
Attribute |
Type |
Description |
Id |
Integer |
Monitor Id for your internal references (Read Only) |
CheckPeriod |
Integer |
Monitor checks frequency in minutes. Possible values: 1 - Every minute2 - Every 2 minutes3 - Every 3 minutes5 - Every 5 minutes10 - Every 10 minutes15 - Every 15 minutes30 - Every 30 minutes60 - Every hour
|
Timeout |
Integer |
Monitor timeout value in seconds. You will receive down alert if requers exeeds Timeout . Possible values: 5 , 10 , 15 , 20 , 25 , 30 , 35 . This field will be ignored for ping ServiceType. |
ServiceType |
String |
Monitored service type. Possible values: http , https , page , smtp , pop3 , imap , ftp , ping , dns , mysql , link , dns lookup , tcp , ssl . You can find more info about ServiceType attribute here. |
SendDefaultAlert |
Boolean |
Send email alert to Default Email Alert contact (can be set on the Profile section). Default value: y . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
SendAltAlert |
String |
List of email addresses those also should be alerted. Email addresses should be separated by semicolon ; or comma , |
FailuresBeforeAlert |
Integer |
Number of faile checks befure Email Alert. Possible values: 1 - send email alert instantly after 1st failed check2 - send email alert after 2nd failed check3 - send email alert after 3rd failed check4 - send email alert after 4th failed check5 - send email alert after 5th failed check
|
SendDefaultSMS |
Boolean |
Send SMS alert to Default Mobile Phone number (can be set on the Profile section). Default value: n . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
SendAltSMS |
String |
List of phone number those also should be alerted. Numbers should contain country code (ex: +11234567890 for US numbers) and separated by semicolon ; or comma , |
FailuresBeforeSMS |
Integer |
Number of faile checks befure SMS Alert. Possible values: 1 - send SMS alert instantly after 1st failed check2 - send SMS alert after 2nd failed check3 - send SMS alert after 3rd failed check4 - send SMS alert after 4th failed check5 - send SMS alert after 5th failed check
|
SendJabberAlert |
Boolean |
Send Jabber/XMPP alert to Default Jabber/XMPP contact (can be set on the Profile section). Default value: n . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
WebHookUrl |
String |
Webhook alert handler URL. |
DownAlertSubject |
String |
The subject of 'DOWN' alerts message for email alerts, or content of 'DOWN' alert mesage for SMS alerts |
UpAlertSubject |
String |
The subject of 'UP' alerts message for email alerts, or content of 'UP' alert mesage for SMS alerts |
RepeatAlerts |
Integer |
Repeat DOWN alerts. Default value: 0 . Possible values: -1 - Send DOWN alert on every failed check0 - Do not repeat DOWN alerts30 - Repeat DOWN alerts every 30 minutes.60 - Repeat DOWN alerts every hour.
|
NoUpAlerts |
Boolean |
Do not send UP alerts. Default value: n . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
HighPriorityAlerts |
Boolean |
Send email alerts with High Priority flag. Default value: y . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
Enabled |
Boolean |
Whatever monitor is Active or not. Default value: y . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
PublicStatAllowed |
Boolean |
Allow public access to monitor statistics report. Default value: y . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
HostPage |
String |
This attribute will contain PageUrl for page and link monitors, and HostName for all other monitor types (Read Only) |
Status |
String |
Monitor status as string. Possible values: active if monitor is active, or not_active if monitor is disabled or down if downtime is detected (Read Only) |
StatusMessage |
String |
Monitor status message. Possible values: Monitor is UP , Monitor is DOWN or Monitor is INACTIVE (Read Only) |
PubStatUrl |
String |
URI of public statistics report page (Read Only) |
LastCheckDate |
Datetime |
Date and time of last monitor check in YYYY-MM-DD HH:mm:ss format (Read Only) |
LastCheckDateFormatted |
String |
Formatted last check date and time. Example: 32 sec. ago (Read Only) |
TotalChecks |
Integer |
Total number of performed checks (Read Only) |
TotalOutages |
Integer |
Total number of detected outages (Read Only) |
TotalFailedChecks |
Integer |
Total number of failed checks (Read Only) |
TotalUptime |
Float |
Total uptime in percents (Read Only) |
View raw JSON
{
"Id": "234342",
"Name": "domain.com",
"CheckPeriod": "5",
"ServiceType": "http",
"Port": "80",
"HostName": "domain.com",
"HTTPAuthLogin": "user1",
"HTTPAuthPassword": "pass123",
"SendDefaultAlert": "y",
"SendAltAlert": "domain.support@gmail.com;user.name@hotmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "+11234567890;+10987654321",
"FailuresBeforeSMS": "3",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "15",
"DownAlertSubject": "Domain.com (http) is Down!",
"UpAlertSubject": "Domain.com (http) is Up!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=234342",
"LastCheckDate": "2014-07-23 13:08:12",
"LastCheckDateFormatted": "34 sec. ago",
"TotalChecks": 909600,
"TotalOutages": 449,
"TotalFailedChecks": 921,
"TotalUptime": 99.899
}
web page monitor attributes
Attribute |
Type |
Description |
PageUrl |
String |
Your web page URI. It can be regular (http://) or secured (https://) web page. |
SearchTerm |
String |
String to search in web page HTML content. Note: we lookup only first 50Kb of web page code. |
InverseSearch |
Boolean |
Allow to 'inverse' SearchTerm monitoring. I.e. ServiceUptime will alert you if found SearchTerm in your webpage content. Default value: n . Possible values: y , 1 , true - Enabledn , 0 , false - Disabled
|
View raw JSON
{
"Id": "162345",
"Name": "domain.com",
"CheckPeriod": "10",
"ServiceType": "page",
"Port": "0",
"PageUrl": "http://www.domain.com/",
"SearchTerm": "Welcome to Domain.com!",
"InverseSearch": "n",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "y",
"SendAltAlert": "tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "y",
"SendAltSMS": "+11234567890",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "30",
"DownAlertSubject": "Something wrong with Domain.com homepage",
"UpAlertSubject": "All OK with Domain.com homepage",
"RepeatAlerts": "60",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "http://www.domain.com/",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=162345",
"LastCheckDate": "2014-07-23 14:34:05",
"LastCheckDateFormatted": "3 min. ago",
"TotalChecks": 12588,
"TotalOutages": 1,
"TotalFailedChecks": 2,
"TotalUptime": 99.984
}
web page, http and https monitor attributes
Attribute |
Type |
Description |
HTTPAuthLogin |
String |
Basic HTTP authorization username |
HTTPAuthPassword |
String |
Basic HTTP authorization password |
View raw JSON
{
"Id": "234342",
"Name": "domain.com",
"CheckPeriod": "5",
"ServiceType": "http",
"Port": "80",
"HostName": "domain.com",
"HTTPAuthLogin": "user1",
"HTTPAuthPassword": "pass123",
"SendDefaultAlert": "y",
"SendAltAlert": "domain.support@gmail.com;user.name@hotmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "+11234567890",
"FailuresBeforeSMS": "3",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "15",
"DownAlertSubject": "Domain.com (http) is Down!",
"UpAlertSubject": "Domain.com (http) is Up!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=234342",
"LastCheckDate": "2014-07-23 13:08:12",
"LastCheckDateFormatted": "34 sec. ago",
"TotalChecks": 909600,
"TotalOutages": 449,
"TotalFailedChecks": 921,
"TotalUptime": 99.899
}
dns lookup monitor attributes
Attribute |
Type |
Description |
HostName |
String |
Domain name or host name or IP of name server to be monitored. |
LookupDomain |
String |
Domain name to lookup in the name server provided in the HostName attribute |
ExpectIp |
String |
Expected IP address. You will be alerted ServiceUptime resolve another IP address for your LookupDomain |
View raw JSON
{
"Id": "151567",
"Name": "Domain.com DNS Lookup",
"CheckPeriod": "30",
"ServiceType": "dns lookup",
"Port": "53",
"HostName": "ns1.out-host-provider.com",
"LookupDomain": "domain.com",
"ExpectIp": "123.45.67.89",
"SendDefaultAlert": "n",
"SendAltAlert": "tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "20",
"DownAlertSubject": "NS Server problem!",
"UpAlertSubject": "NS Server OK!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=151567",
"LastCheckDate": "2014-07-23 12:13:13",
"LastCheckDateFormatted": "22 min. ago",
"TotalChecks": 73453,
"TotalOutages": 3,
"TotalFailedChecks": 13,
"TotalUptime": 99.982
}
link monitor attributes
Attribute |
Type |
Description |
PageUrl |
String |
Web page page URI where ServiceUptime should watch your back link. It can be regular (http://) or secured (https://) web page. |
SearchLink |
String |
Back link URL (href attribute of A HTML tag) |
View raw JSON
{
"Id": "150232",
"Name": "Promo back link on market-talk.com",
"CheckPeriod": "60",
"ServiceType": "link",
"PageUrl": "http://market-talk.com",
"SearchLink": "www.domain.com",
"SendDefaultAlert": "n",
"SendAltAlert": "domain.support@gmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "10",
"DownAlertSubject": "Our Ad link is missed!",
"UpAlertSubject": "Our Ad link is OK!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "n",
"Enabled": "y",
"PublicStatAllowed": "n",
"HostPage": "http://market-talk.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=150232",
"LastCheckDate": "2014-07-23 12:43:12",
"LastCheckDateFormatted": "3 min. ago",
"TotalChecks": 230,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 100
}
All other monitors except web page, dns lookup and link
Attribute |
Type |
Description |
HostName |
String |
Domain name or host name or IP to be monitored. |
Port |
Integer |
Monitored port. Default port will be used if empty. This field will be ignored for ping ServiceType. |
View raw JSON
{
"Id": "934342",
"Name": "Database Server",
"CheckPeriod": "15",
"ServiceType": "mysql",
"Port": "3306",
"HostName": "mysql.domain.com",
"SendDefaultAlert": "y",
"SendAltAlert": "domain.support@gmail.com;user.name@hotmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "+11234567890",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "y",
"WebHookUrl": "",
"Timeout": "25",
"DownAlertSubject": "MySQL server is Down!",
"UpAlertSubject": "MySQL server is Up!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "mysql.domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=934342",
"LastCheckDate": "2014-07-23 13:08:12",
"LastCheckDateFormatted": "22 sec. ago",
"TotalChecks": 909600,
"TotalOutages": 449,
"TotalFailedChecks": 921,
"TotalUptime": 99.459
}
Supported Monitor Types
ServiceType |
Default Port |
Description |
http |
tcp:80 |
Web-server (Apache, Microsoft IIS, NGNX, etc) monitoring |
https |
ssl:443 |
Secure Web-server (Apache, Microsoft IIS, Nginx, etc) monitoring |
page |
<empty> |
Web page content motitoring. Also useful for SOAP, ATOM, RSS, etc monitoring. |
smtp |
tcp:25 |
Outgoing email server (Postfix, Courier, Sendmail, MS Exchange Server, etc) |
pop3 |
tcp:110 |
Incomming email server (Qmail, Dovecot, MS Exchange Server, etc) |
imap |
tcp:143 |
Incomming email server (Qmail, Dovecot, MS Exchange Server, etc) |
ftp |
tcp:21 |
File transfer protocol server |
ping |
<empty> |
PING service |
dns |
udp:53 |
Name Server (BIND, PowerDNS, etc) |
dns lookup |
udp:53 |
Name Server (BIND, PowerDNS, etc) will be looked up for your LookupDomain and returned IP address will be compared with your ExpectIp address |
mysql |
tcp:3306 |
MySQL database server monitoring. Please do not forget to allow incomming connections from our check locations. |
link |
<empty> |
The PageUrl content will be checked for your SearchLink back link. Useful for marketing links monitoring. |
tcp |
tcp:8080 |
Custom TCP port monitoring |
ssl |
ssl:995 |
Custom SSL port monitoring |
tls |
tls:995 |
Custom TLS port monitoring |
API Errors
Every API error will result 4xx or 5xx HTTP error code with error detailes in JSON object.
JSON Error Object
Attribute |
Value |
Description |
status |
failed |
Request status |
err_code |
Integer |
4xx or 5xx error code |
err_msg |
String |
Error description |
data |
Object |
Error data (for example validation result for add-monitor or update-monitor requests) |
Error Codes
Error Code |
Description |
500 |
Wrong API Key |
403 |
Your account is suspended |
403 |
API is not available on free accounts |
400 |
Wrong API Method |
401 |
Access denied (API Key have no permission for requested action) |
404 |
Monitor not found |
500 |
API Error. Please try again later |
520 |
Validation error (the data attribute will contain set of attributes with validation errors) |
View raw JSON
{
"status": "failed",
"err_code": "520",
"err_msg": "Validation error",
"data": {
"HostName": "Incorrect HostName."
}
}
API Response
Every successful API request will result '200 OK' HTTP code with response info as JSON object.
JSON Response Object
Attribute |
Value |
Description |
status |
success |
Request status |
err_code |
Integer |
0 |
err_msg |
String |
<empty> |
data |
Object |
Response data (for example monitor Id for add-monitor requests) |
View raw JSON
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": 367168
}
}
API Methods
Method |
Description |
add-monitor |
Add new monitor to your ServiceUptime account |
update-monitor |
Edit monitor information |
delete-monitor |
Remove monitor from your ServiceUptime account |
get-monitors |
Retrieve all your monitors information including uptime statistics summary and current status info. |
get-report |
Retrieve detailed uptime report for your monitor. |
monitor-info |
Retrieve one monitor information including uptime statistics summary and current status info. |
start-monitor |
Start monitoring for a paused monitor. |
stop-monitor |
Pause monitoring for a monitor. |
account-info |
Retrieve account information such as number of SMS credits, available monitors, default email alert, etc. |
Add New Monitor
Method name: add-monitor
Method URI: http://www.serviceuptime.com/api/{API_Key}/add-monitor
This method creates new monitor under your ServiceUptime account
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
Monitor object should be sent to method URI by HTTP POST or as JSON request (JSON object in the HTTP POST request body) |
View raw JSON/POST
JSON:
{
"Name": "Database Server",
"CheckPeriod": "15",
"ServiceType": "mysql",
"Port": "3306",
"HostName": "mysql.domain.com",
"SendDefaultAlert": "y",
"SendAltAlert": "domain.support@gmail.com;user.name@hotmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "+11234567890",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "y",
"WebHookUrl": "",
"Timeout": "25",
"DownAlertSubject": "MySQL server is Down!",
"UpAlertSubject": "MySQL server is Up!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y"
}
POST:
Name=Database%20Server&CheckPeriod=15&ServiceType=mysql&Port=3306&HostName=mysql
.domain.com&SendDefaultAlert=y&SendAltAlert=domain.support%40gmail.com%3Buser.na
me%40hotmail.com%3Btech%40domain.com&FailuresBeforeAlert=1&SendDefaultSMS=n&Send
AltSMS=%2B11234567890&FailuresBeforeSMS=1&SendJabberAlert=y&WebHookUrl=&Timeout=25&DownAlert
Subject=MySQL%20server%20is%20Down%21&UpAlertSubject=MySQL%20server%20is%20Up%21
&RepeatAlerts=0&NoUpAlerts=n&HighPriorityAlerts=y&Enabled=y&PublicStatAllowed=y
Response
Data |
Data Type |
Description |
Json Response Object |
JSON |
As result API will return JSON Response Object with created monitor Id on success, or JSON Error Object if request is failed. In case of validation error response will contain attributes validation errors in the data attribute of JSON Error Object. |
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": 367168
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "520",
"err_msg": "Validation error",
"data": {
"HostName": "Incorrect HostName."
}
}
Edit Monitor
Method name: update-monitor
Method URI: http://www.serviceuptime.com/api/{API_Key}/update-monitor
This method updates existing monitor. The input Monitor Object can by reduced to field that you need to change, only Id
attribute is mandatory. In this case all other attributes will not be updated.
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
Monitor object should be sent to method URI by HTTP POST or as JSON request (JSON object in the HTTP POST request body). Can be redused to changed attributes only. |
View raw JSON/POST
JSON:
{
"Id": "367168",
"ServiceType": "https",
"Port": "443"
}
POST:
Id=367168&ServiceType=https&Port=443
Response
Data |
Data Type |
Description |
Json Response Object |
JSON |
As result API will return JSON Response Object with updated monitor Id on success, or JSON Error Object if request is failed. In case of validation error response will contain attributes validation errors in the data attribute of JSON Error Object. |
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": 367168
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "520",
"err_msg": "Validation error",
"data": {
"HostName": "Incorrect HostName."
}
}
Delete Monitor
Method name: delete-monitor
Method URI: http://www.serviceuptime.com/api/{API_Key}/delete-monitor
This method deletes existing monitor. The input Monitor Object must contain Id
attribute.
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
The input Monitor Object must contain Id attribute. |
View raw JSON/POST
JSON:
{
"Id": "367168"
}
POST:
Id=367168
Response
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": 'Monitor has been deleted'
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "Monitor not found",
"data": []
}
Get All Monitors
Method name: get-monitors
Method URI: http://www.serviceuptime.com/api/{API_Key}/get-monitors
This method returnes all your moniotors as set of Monitor Objects in the data
field of Response Object.
Request
Data |
Data Type |
Description |
<empty> |
Empty request |
This method requires no input data. |
Response
Data |
Data Type |
Description |
Json Response Object |
JSON |
As result API will return JSON Response Object with set of Monitor Objects in the data attribute on success, or JSON Error Object if request is failed. |
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": [
{
"Id": "347585",
"Name": "domain.com",
"CheckPeriod": "30",
"ServiceType": "http",
"Port": "80",
"HostName": "domain.com",
"PageUrl": "",
"SearchTerm": "",
"HTTPAuthLogin": "user1",
"HTTPAuthPassword": "pass123",
"SendDefaultAlert": "y",
"SendAltAlert": "domain.support@gmail.com;user.name@hotmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "+1 1234567890",
"FailuresBeforeSMS": "3",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "15",
"DownAlertSubject": "Domain.com (http) is Down!",
"UpAlertSubject": "Domain.com (http) is Up!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=347585",
"LastCheckDate": "2014-07-23 12:08:12",
"LastCheckDateFormatted": "7/23/2014",
"TotalChecks": 909600,
"TotalOutages": 449,
"TotalFailedChecks": 921,
"TotalUptime": 99.899
},
{
"Id": "87456",
"Name": "Promo back link on market-talk.com",
"CheckPeriod": "60",
"ServiceType": "link",
"Port": "0",
"HostName": "",
"PageUrl": "http://market-talk.com",
"SearchLink": "www.domain.com",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "n",
"SendAltAlert": "domain.support@gmail.com;tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "10",
"DownAlertSubject": "Our Ad link is missed!",
"UpAlertSubject": "Out Ad link is OK!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "n",
"Enabled": "y",
"PublicStatAllowed": "n",
"HostPage": "http://market-talk.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=87456",
"LastCheckDate": "2014-07-23 11:43:12",
"LastCheckDateFormatted": "7/23/2014",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
},
{
"Id": "458332",
"Name": "Domain.com DNS Lookup",
"CheckPeriod": "30",
"ServiceType": "dns lookup",
"Port": "53",
"HostName": "ns1.out-host-provider.com",
"LookupDomain": "domain.com",
"ExpectIp": "123.45.67.89",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "n",
"SendAltAlert": "tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "20",
"DownAlertSubject": "NS Server problem!",
"UpAlertSubject": "NS Server OK!",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "domain.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=458332",
"LastCheckDate": "2014-07-23 11:13:13",
"LastCheckDateFormatted": "7/23/2014",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
},
{
"Id": "285493",
"Name": "domain.com",
"CheckPeriod": "10",
"ServiceType": "page",
"Port": "0",
"HostName": "",
"PageUrl": "http://http://www.domain.com/",
"SearchTerm": "Welcome to Domain.com!",
"InverseSearch": "n",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "y",
"SendAltAlert": "tech@domain.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "y",
"SendAltSMS": "+1 1234567890",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "30",
"DownAlertSubject": "Something wrong with Domain.com homepage",
"UpAlertSubject": "All OK with Domain.com homepage",
"RepeatAlerts": "60",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "http://http://www.domain.com/",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=285493",
"LastCheckDate": "N/A",
"LastCheckDateFormatted": "Never checked",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
},
{
"Id": "347584",
"Name": "test API",
"CheckPeriod": "60",
"ServiceType": "http",
"Port": "80",
"HostName": "test-api.com",
"PageUrl": "",
"SearchTerm": "",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "n",
"SendAltAlert": "user@test-api.com",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "10",
"DownAlertSubject": "{HostName} ({Service}) is Down",
"UpAlertSubject": "{HostName} ({Service}) is Available",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "test-api.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=347584",
"LastCheckDate": "N/A",
"LastCheckDateFormatted": "Never checked",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
},
{
"Id": "256473",
"Name": "test API 3",
"CheckPeriod": "30",
"ServiceType": "https",
"Port": "443",
"HostName": "test-api3.com",
"PageUrl": "",
"SearchTerm": "",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "n",
"SendAltAlert": "",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "10",
"DownAlertSubject": "{HostName} ({Service}) is Down",
"UpAlertSubject": "{HostName} ({Service}) is Available",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "test-api3.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=256473",
"LastCheckDate": "N/A",
"LastCheckDateFormatted": "Never checked",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
}
]
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "You have no monitors",
"data": []
}
Get Uptime Report
Method name: get-report
Method URI: http://www.serviceuptime.com/api/{API_Key}/get-report
This method returnes detailed uptime report for a monitor as JSON Object in the data
field of Response Object.
Request
Data |
Data Type |
Description |
Request Object |
JSON or POST |
The input Request Object must contain: Id attribute set to Monitor Idfrom_date Date in format YYYY-MM-DD to_date Date in format YYYY-MM-DD
|
View raw JSON/POST
JSON:
{
"Id": "367168",
"from_date": "2014-11-01",
"to_date": "2014-11-07"
}
POST:
Id=367168&from_date=2014-11-01&to_date=2014-11-07
Response
Data |
Data Type |
Description |
Json Response Object |
JSON |
As result API will return JSON Response Object with uptime report in the data attribute on success, or JSON Error Object if request is failed. |
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Checks": [
{
"From": "2014-11-14 00:34:04",
"FromUTC": "2014-11-13 18:34:04",
"To": "2014-11-14 23:56:28",
"ToUTC": "2014-11-14 17:56:28",
"NumChecks": "280",
"CheckResult": "Ok",
"AvgResponseTime": "0.277"
},
{
"From": "2014-11-15 00:31:36",
"FromUTC": "2014-11-14 18:31:36",
"To": "2014-11-15 20:47:59",
"ToUTC": "2014-11-15 14:47:59",
"NumChecks": "243",
"CheckResult": "Ok",
"AvgResponseTime": "0.707"
},
{
"From": "2014-11-15 20:57:28",
"FromUTC": "2014-11-15 14:57:28",
"To": "2014-11-15 21:01:05",
"ToUTC": "2014-11-15 15:01:05",
"NumChecks": "2",
"CheckResult": "Failed",
"AvgResponseTime": "0.000",
"Failures": [
{
"FailureDate": "2014-11-15 20:57:28",
"FailureUTC": "2014-11-15 14:57:28",
"ErrorMsg": "Cannot get page specified",
"ConfirmedFrom": [
{
"Location": "Scranton, PA, US",
"IP": "192.187.116.50"
},
{
"Location": "New York, NY, US",
"IP": "66.45.252.18"
}
]
},
{
"FailureDate": "2014-11-15 21:01:05",
"FailureUTC": "2014-11-15 15:01:05",
"ErrorMsg": "Unable to connect",
"ConfirmedFrom": [
{
"Location": "New York, NY, US",
"IP": "66.45.252.18"
},
{
"Location": "Gunzenhausen, GE",
"IP": "213.239.217.16"
}
]
}
]
},
{
"From": "2014-11-15 21:03:43",
"FromUTC": "2014-11-15 15:03:43",
"To": "2014-11-15 23:58:58",
"ToUTC": "2014-11-15 17:58:58",
"NumChecks": "36",
"CheckResult": "Ok",
"AvgResponseTime": "0.908"
},
{
"From": "2014-11-16 00:00:06",
"FromUTC": "2014-11-15 18:00:06",
"To": "2014-11-16 23:56:54",
"ToUTC": "2014-11-16 17:56:54",
"NumChecks": "278",
"CheckResult": "Ok",
"AvgResponseTime": "0.331"
}
],
"Summary": {
"Id": "8",
"TimeZone":"(GMT +06:00) Dhaka",
"From": "2014-11-14 00:00:00",
"To": "2014-11-16 23:59:59",
"NumChecks": 839,
"NumOutages": 1,
"NumFailedChecks": 2,
"Uptime": 99.762,
"AvgResponseTime": 0.447,
"LastCheck": "2 sec ago"
}
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "Monitor not found",
"data": []
}
Get Monitor Info
Method name: monitor-info
Method URI: http://www.serviceuptime.com/api/{API_Key}/monitor-info
Get info for a single monitor. The input Monitor Object must contain Id
attribute.
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
The input Monitor Object must contain Id attribute. |
View raw JSON/POST
JSON:
{
"Id": "256473"
}
POST:
Id=256473
Response
View raw JSON
Succesful request (JSON Monitor Object):
{
"Id": "256473",
"Name": "test API 3",
"CheckPeriod": "30",
"ServiceType": "https",
"Port": "443",
"HostName": "test-api3.com",
"PageUrl": "",
"SearchTerm": "",
"HTTPAuthLogin": "",
"HTTPAuthPassword": "",
"SendDefaultAlert": "n",
"SendAltAlert": "",
"FailuresBeforeAlert": "1",
"SendDefaultSMS": "n",
"SendAltSMS": "",
"FailuresBeforeSMS": "1",
"SendJabberAlert": "n",
"WebHookUrl": "",
"Timeout": "10",
"DownAlertSubject": "{HostName} ({Service}) is Down",
"UpAlertSubject": "{HostName} ({Service}) is Available",
"RepeatAlerts": "0",
"NoUpAlerts": "n",
"HighPriorityAlerts": "y",
"Enabled": "y",
"PublicStatAllowed": "y",
"HostPage": "test-api3.com",
"Status": "active",
"StatusMessage": "Monitor is UP",
"PubStatUrl": "http://www.serviceuptime.com/users/uptimemonitoring.php?S=e4c9e21eb1222a4adb4a1da4cbc4a653&Id=256473",
"LastCheckDate": "N/A",
"LastCheckDateFormatted": "Never checked",
"TotalChecks": 0,
"TotalOutages": 0,
"TotalFailedChecks": 0,
"TotalUptime": 0
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "Monitor not found",
"data": []
}
Stop Monitor
Method name: stop-monitor
Method URI: http://www.serviceuptime.com/api/{API_Key}/stop-monitor
This method stops monitoring for a single monitor. The input Monitor Object must contain Id
attribute.
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
The input Monitor Object must contain Id attribute. |
View raw JSON/POST
JSON:
{
"Id": "367168"
}
POST:
Id=367168
Response
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": '367168'
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "Monitor not found",
"data": []
}
Start Monitor
Method name: start-monitor
Method URI: http://www.serviceuptime.com/api/{API_Key}/start-monitor
This method resumes monitoring for a stopped monitor. The input Monitor Object must contain Id
attribute.
Request
Data |
Data Type |
Description |
Monitor Object |
JSON or POST |
The input Monitor Object must contain Id attribute. |
View raw JSON/POST
JSON:
{
"Id": "367168"
}
POST:
Id=367168
Response
As response this method returns JSON object with account information:
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"Id": '367168'
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "404",
"err_msg": "Monitor not found",
"data": []
}
Get ServiceUptime Account Info
Method name: account-info
Method URI: http://www.serviceuptime.com/api/{API_Key}/account-info
This method return account information.
Request
Data |
Data Type |
Description |
<empty> |
Empty request |
This method requires no input data. |
Response
As response this method returns JSON Response Object with account information data in the data
attribute:
Data |
Data Type |
Description |
Json Response Object |
JSON |
As result API will return JSON Response Object with account info in the data attribute on success, or JSON Error Object if request is failed.
data attribute structure:
NumMonitors - Number of existing monitors
DefaultAlertEmail - Default email address for email alerts
DefaultPhoneNumber - Default phone number for SMS alerts
DefaultJabberAccount - Default Jabberaccount for XMPP alerts
SMSCredits - Number of available SMS credits
TimeZone - Account time zone
DaylightSaving - Whatever daylight saving is enabled for time zone (possible values: y or n )
Package - Account premuim package name
LastPaymentDate - Last payment date (in the format YYYY-MM-DD )
AvailableMonitors - Set of available check intervals and number of monitors available for every interval
|
View raw JSON
Succesful request (JSON Response Object):
{
"status": "success",
"err_code": 0,
"err_msg": "",
"data": {
"NumMonitors": 6,
"DefaultAlertEmail": "uptime@comain.com",
"DefaultPhoneNumber": "+1234567898",
"DefaultJabberAccount": "domain.com@jabber.org",
"SMSCredits": "54",
"TimeZone": "(GMT -06:00) Central Time (US & Canada)",
"DaylightSaving": "y",
"Package": "Premium: ($25/month)",
"LastPaymentDate": "2014-08-26",
"AvailableMonitors": {
"60": 6,
"30": 3,
"15": 2,
"10": 2,
"5": 1,
"3": 0,
"2": 0,
"1": 0
}
}
}
Failed request (JSON Error Object):
{
"status": "failed",
"err_code": "403",
"err_msg": "Your account is suspended",
"data": []
}