HostTracker help - api REST incident operations

  1. GET /api/web/v1/incident - get incidents for tasks by filter.
GET /api/web/v1/incident - get incidents for tasks.
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/incident 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 incident operations):
  • startTime - string, start date of interval - should be in format you selected in profile.
    This parameter have no effect if you also specify startTimeUnix in query string.
    Instead, start date will be calculated from startTimeUnix. If both startTime and startTimeUnix are empty
    then startTime will be choosen to be a date of 1 month before current moment of request for incidents.
    Important: dates you provide in one of parameters (startTime, endTime, startTimeUnix, endTimeUnix)
    are treated as time in time zone of your current profile (UNLESS you specify a parameter getInUtcTimeZone=1).
  • endTime - string, end date of interval - should be in format you selected in profile.
    This parameter have no effect if you also specify endTimeUnix in query string.
    Instead, end date will be calculated from endTimeUnix. If both endTime and endTimeUnix are empty
    then endTime will be the current moment of time.
    Important: dates you provide in one of parameters (startTime, endTime, startTimeUnix, endTimeUnix)
    are treated as time in time zone of your current profile (UNLESS you specify a parameter getInUtcTimeZone=1).
  • startTimeUnix - int, unix timestamp - number of seconds from 01.01.1970.
    startTime = getDateTime(01.01.1970 00:00:00 + startTimeUnix)
    In query string you usualy provide pair (startTimeUnix, endTimeUnix) or pair (startTime, endTime).
    Important: dates you provide in one of parameters (startTime, endTime, startTimeUnix, endTimeUnix)
    are treated as time in time zone of your current profile (UNLESS you specify a parameter getInUtcTimeZone=1).
  • endTimeUnix - int, unix timestamp - number of seconds from 01.01.1970.
    endTime = getDateTime(01.01.1970 00:00:00 + endTimeUnix)
    In query string you usualy provide pair (startTimeUnix, endTimeUnix) or pair (startTime, endTime).
    Important: dates you provide in one of parameters (startTime, endTime, startTimeUnix, endTimeUnix)
    are treated as time in time zone of your current profile (UNLESS you specify a parameter getInUtcTimeZone=1).
  • getInUtcTimeZone - could be 0 or 1
    if 1 then all dates & times of incidents will be returned in UTC time zone.
    if 0 then the time zone from profile will be used
  • 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: the object with taskIncidents property - array of TaskIncidents objects, each with fields:
  • startTime - string, formated according to profile DateTime format settings.
    Shows startTime query filter parameter, that was used for obtained incidents
    It is returned always, even if you do not specify it in IncidentFilter
  • endTime - string, formated according to profile DateTime format settings.
    Shows endTime query filter parameter, that was used for obtained incidents
    It is returned always, even if you do not specify it in IncidentFilter
  • startTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
    Corresponds to startTime return parameter
  • endTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
    Corresponds to endTime return parameter
  • timeZone - time zone of dates and times in returned incidents and query filter parameters
    Equals to UTC if getInUtcTimeZone is 1 in filter
  • taskIncidents - Array of information about task incidents.
    Each element contains two fields:
    • task - TaskReference (or Task if fullTask is true in request)
    • incidents - Array of Incident objects
Incident object fields:
  • taskId - string, Guid of monitoring task
  • checkId - int, sequential check number for this monitoring task
  • startTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
    - moment of detected incident in requested time zone.
  • endTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
    - denotes end of check which detected the incident
  • location - Location object:
    agentId - Guid of location from which incident was detected,
    city, state, country - fields of the location
  • recheckTimeUnix - big int
    - timestamp of recheck start which confirmed the incident
  • recheckDurationSec - int
    - recheck duration in seconds
  • isUnderMaintenance - int
    - nonpresent if the incident is not under maintenance. Otherwise, the value > 0.
  • error - CheckError object
    - errorType - string, denotes the error category,
    - errorCode - int, subcategory of the error
    - errorMessage - string, plain message of the error if no subcategory could be defined
    - errorDescription - string, error summary deduced from other three fields.
  • hasSnapshot - bool
    - snapshot is byte array of site state at incident moment. For http monitoring it is document html, for pagespeed is the image of site.
  • recheck - confirmation of incident
    - okLocations - location objects which did not detect the incident
    - failLocationsByError - recheck error with attached locations. Fields of CheckError object + locations: Location[]

Help pages by categories