HostTracker REST API. Stats operations

  1. GET /api/web/v1/stats - get uptime statistics for tasks by filter. Here you can specify time interval for statistics and expected SLA. Minimum interval is one day.
GET /api/web/v1/stats - get uptime statistics for tasks. You usually filter stats by query string parameters explained bellow.
Request headers:
Authorization: bearer your auth.token here (how to get token see user operations)
Accept or Content-Type specifies response content format: application/json, text/xml.
GET https://www.host-tracker.com/api/web/v1/stats HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 0
Query string parameters (inherited from task filter):
  • ids - return only tasks with ids specified in ids url parameter.
    For specifying many ids use this example: ?ids=guid1&ids=guid2&ids=guid3.
  • excludeIds - exclude ids specified in ids array and return other tasks. ?excludeIds=true
  • taskType - task type to search for. ?taskType=Http (case sensitive)
  • taskTypes - array of task type to search for. ?taskTypes=Http&taskTypes=Ping (case sensitive)
  • excludeTaskTypes - exclude tasks with taskType and taskTypes - return other tasks. ?excludeTaskTypes=true.
  • status - Enabled or Disabled. ?excludeTaskTypes=Disabled - return only disabled tasks.
  • url - task with specified url to search for. Url should be url encoded. ?url=http%3A%2F%2Fwww.mysite.com%2Fsome%2Ffile.js
  • urls - task with specified urls to search for. Url in urls array should be url encoded. ?urls=http%3A%2F%2Fwww.mysite.com%2Fsome%2Ffile.js&urls=http%3A%2F%2Fgoogle.com
  • urlSearchLike - specified only with url parameter (not urls). If true like search will be performed.
    ?url=mysite&urlSearchLike=true - will return tasks with url: http://www.mysite.com/some/file.js, http://www.mysite.com and other which contains mysite.
  • excludeUrls - exclude tasks with specified urls (in url and urls parameter).
    ?url=mysite&urlSearchLike=true&excludeUrls=true - return all tasks which do not contain mysite in url.
  • name - search task with specified name.
    If name(names) and id(ids) are specified in url query string - search will use OR join for results.
    For ex. ?id=guid1&name=mytask will return tasks with name mytask and task with id guid1.
    Combining name(names) with other filter parameters will result in AND join -
    all returned tasks should contain name as specified in name (names) parameter.
  • names - array of names to search for. ?names=mytask1&names=mytask2
  • nameSearchLike - perform like search for name (could not be used with names). ?name=mytask&nameSearchLike=true
  • excludeNames - exclude tasks with specified name (names). ?name=mytask&nameSearchLike=true&excludeNames=true
  • interval - search tasks with specified interval. ?interval=1
  • intervals - search tasks with specified intervals. ?intervals=1&intervals=60
  • excludeIntervals - exclude tasks with specified intervals. ?interval=1&excludeIntervals=true
  • openStat - search for public tasks (with public statistics and event log). ?openStat=true or ?openStat=false
  • lastState - search for up or down tasks. ?lastState=true - up tasks or ?lastState=false - down tasks
  • tags - search for tasks with tags. ?tags=server&tags=mymachine
  • overlimited - search for billing overlimited tasks. ?overlimited=true - tasks with overlimit, ?overlimited=false - without.
  • active - search for active or disabled tasks.
    Task could be disabled by HostTracker system or by user.
    This flag indicates system disablence (due to overlimit, low balance, or other).
    For user disablence see status parameter.
    ?active=true - return only active tasks, ?active=false - return only disabled tasks
Query string parameters (specific for statistics operations):
  • statsStart - string, start date of interval - should be in format you selected in profile.
    This parameter have no effect if you also specify statsStartUnix in query string.
    Instead, start date will be calculated from statsStartUnix. If both statsStart and statsStartUnix are empty
    then startDate will be choosen as minimum from creation times of selected by filter tasks.
    Important: dates you provide in one of parameters (statsStart, statsEnd, statsStartUnix, statsEndUnix)
    are treated as time in UTC time zone.
  • statsEnd - string, end date of interval - should be in format you selected in profile.
    This parameter have no effect if you also specify statsEndUnix in query string.
    Instead, end date will be calculated from statsEndUnix. If both statsEnd and statsEndUnix are empty
    then endDate will be the current moment of time.
    Important: dates you provide in one of parameters (statsStart, statsEnd, statsStartUnix, statsEndUnix)
    are treated as time in UTC time zone.
  • statsStartUnix - int, unix timestamp - number of seconds from 01.01.1970.
    StartDate = getJustDate(01.01.1970 00:00:00 + statsStartUnix)
    In query string you usualy provide pair (statsStartUnix, statsEndUnix) or pair (statsStart, statsEnd).
    Important: dates you provide in one of parameters (statsStart, statsEnd, statsStartUnix, statsEndUnix)
    are treated as time in UTC time zone.
  • statsEndUnix - int, unix timestamp - number of seconds from 01.01.1970.
    EndDate = getJustDate(01.01.1970 00:00:00 + statsEndUnix)
    In query string you usualy provide pair (statsStartUnix, statsEndUnix) or pair (statsStart, statsEnd).
    Important: dates you provide in one of parameters (statsStart, statsEnd, statsStartUnix, statsEndUnix)
    are treated as time in UTC time zone.
  • expectedSLA - value between 0.00 and 100.00. Expected SLA.
    if calculated uptime % is less then expectedSLA then in results field slaExpectationSucceeded will be false
    In other case, value in slaExpectationSucceeded will be true.
    If you do not provide expectedSLA in request or task does not have data for detecting practical uptime %, slaExpectationSucceeded will be absent in response
  • fullTask - true or false (default is false). If true than all task information will be returned in task field of StatsForTask object
    In other case (when false or not specified in query string) just TaskReference object will be returned. It contains only id and name field of task.
Response: Stats object with stats property - array of StatsForTask objects. StatsForTask object fields:
  • task - Task object (in case when fullTask=true) as described in task operations.
    Or TaskReference object (in case when fullTask is not specified or false) that contains just id and name of the task.
  • uptimeInMinutes - number of minutes site was up in specified interval (startDate, endDate)
  • downtimeInMinutes - number of minutes site was down in specified interval (startDate, endDate)
  • maintenanceUptimeInMinutes - number of minutes site was up and in maintenance (see maintenance settings) in specified interval (startDate, endDate)
  • maintenanceDowntimeInMinutes - number of minutes site was down and in maintenance (see maintenance settings) in specified interval (startDate, endDate)
  • totalTimeInMinutes - number of minutes site was under monitoring in specified interval (startDate, endDate)
  • uptimeSpan - uptime in format DD.hh:mm:ss, for example: 2.12:03:24 - 2 days, 12 hours, 3 minutes and 24 seconds
  • downtimeSpan - downtime in format DD.hh:mm:ss.
  • maintenanceUptimeSpan - maintenance uptime in format DD.hh:mm:ss.
  • maintenanceDowntimeSpan - maintenance downtime in format DD.hh:mm:ss.
  • totalTimeSpan - total monitoring time in format DD.hh:mm:ss.
  • uptimeChecks - number of checks (site avalability verifications) that resulted in up state.
  • downtimeChecks - number of checks (site avalability verifications) that resulted in down state (site was not accessible or error occured).
  • maintenanceUptimeChecks - number of checks (site avalability verifications) that resulted in up state during maintenance.
  • maintenanceDowntimeChecks - number of checks (site avalability verifications) that resulted in down state during maintenance.
  • totalChecks - number of checks (site avalability verifications) totally performed in interval (startDate, endDate).
  • uptimePercent - uptime in % during (startDate, endDate) calculated by formula: (uptimeInSeconds + maintenanceUptimeInSeconds) / (totalTimeInSeconds - maintenanceDowntimeInSeconds).
    This value will not be returned in response in case when total time of monitoring is 0 or total time of monitoring is maintenance downtime.
  • downtimePercent - downtime in % during (startDate, endDate) calculated by formula: (downtimeInSeconds) / (totalTimeInSeconds - maintenanceDowntimeInSeconds).
    This value will not be returned in response in case when total time of monitoring is 0 or total time of monitoring is maintenance downtime.
  • slaExpectationSucceeded - if you provide in query string expectedSLA parameters, this parameters will contain response to your expectation.
    In other words slaExpectationSucceeded = true when uptimePercent >= expectedSLA and false when uptimePercent < expectedSLA.
Other Stats object fields:
  • statsStart - statsStart date for which uptime was calculated - date is formated as specified in profile.
  • statsEnd - statsEnd date for which uptime was calculated - date is formatted as specified in profile
  • statsStartUnix - int, distance in seconds from 01.01.1970 of the statsStart
  • statsEndUnix - int, distance in seconds from 01.01.1970 of the endStats.
  • expectedSLA - same value you provide in query string.

Help pages by categories