Quick start guide

All requests are made with BASE_URL: https://api1.host-tracker.com/

Content type of requests and responses: application/json. Supported HTTP methods:

  • GET: Retrieve entities, e.g. monitoring tasks, subscriptions, contacts, stats, outages, incindents;
  • POST: Create new entities or start an action;
  • PUT: Update existing entities;
  • DELETE: Remove entities;
  • PATCH: Partially update resources.

Authentication

All operations but user token retrieving require authentication information in http headers. Authentication performed by using Authorization Http header with specified bearer token. Token is created by POST request with login, password data to BASE_URL/users/token. See details on user operations help page.

Example of token usage:

 
GET BASE_URL/task/7EE87894-B8A9-E311-BEB2-DC85DE1F0BC2 HTTP/1.1
User-Agent: Fiddler
Host: www.host-tracker.com
Content-Type: application/json
Authorization: bearer your token here
Content-Length: 0

CORS and http method overriding

CORS is enabled for all origins (response contains header Access-Control-Allow-Origin: *). This allows, for example, API access via JQuery AJAX requests.

If you could not use DELETE, PUT, PATCH requests for accessing API use X-HTTP-Method-Override header with POST request to resourse.

For example, for task updating you could send PUT request to BASE_URL/tasks or send POST to BASE_URL/tasks with X-HTTP-Method-Override: PUT

POST /users/token

get authorization token for requests to other API

Request json
{
"login": "your login here",
"password": "your password here"
}

To login for a management of an account to which you were given permissions (a.k.a. as subaccount), use "forLogin" field.

Request json
{"login":"subaccount login",
"password":"subaccount pwd",
"forLogin": "superaccount login"}

In this case, returned token allows you to manage superaccount information in same way as you work with API methods directly for your own account. The corresponding rights have to been granted by superaccount in order for operation to succeed. For example, if superaccount grants read only rights to monitoring tasks, the returned token will allow you to fetch monitoring information, but POST, PUT, PATCH, DELETE methods that alter monitoring state will be prohibited.

200 OK response json
{
    "ticket":"your token here",
    "expirationTime":"token expiration",
    "expirationUnixTime":int value - token expiration unix time
}

401 IncorrectLoginOrPassword - incorect login or password

Example request
POST BASE_URL/users/token HTTP/1.1
User-Agent: MyClient
Content-Type: application/json
Content-Length: 37
        
{"login":"login", "password":"password"}

Api REST task operations

BASE_URL: https://api1.host-tracker.com

GET BASE_URL/tasks/intervals

get array of accepted task intervals.

Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

     
    [1,5,15,30,60]
    

    GET BASE_URL/tasks/types

    get array of accepted task types. Currently ["Http","Ping","Port"] for all operations, ["Database","Snmp"] - read only, "Counter" - in development

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

     
    ["Counter","DNSBL","Database","Http","Ping","Port","Snmp"]
    

    GET BASE_URL/tasks/{id:guid}

    get task by id (GUID).

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

    Task data

    GET BASE_URL/tasks

    get all tasks or filtered via query string parameters.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Query string parameters (all are optional):

    • info - specify what additional task information to return.
      • subscriptions - return subscriptions (for alerts and reports) for task
      • stats - return statistics (daily, monthly, yearly, total) for task
      • results - return results for interval (sdtu, edtu) from query string.
        if (sdtu, edtu) is not provided - return last result for task.
        Results are returned as array in results field of task.
      Several values could be specified using comma. For ex.: info=stats,subscriptions.
      Also you could use int value for each flag:
      • subscriptions bit 0001 - 1
      • stats bit 0010 - 2
      • results bit 0100 - 4
      In such case info=stats,subscriptions,results is same to info=7(0111).
    • ids - return only tasks with ids specified in ids url parameter.
      If you search by one id - see method GET BASE_URL/tasks/{id:guid}
      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
    • urls - task with specified urls to search for. Url in urls array should be url encoded.
    • 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).
    • 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).
    • 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
    • sdtu - int64, unix timestamp, UTC - number of seconds from 01.01.1970.
      start time = (01.01.1970 00:00:00 + sdtu)
      See edtu and notes bellow.
    • edtu - int64, unix timestamp, UTC - number of seconds from 01.01.1970.
      end time = (01.01.1970 00:00:00 + edtu)
      In query string you need to provide both (sdtu, edtu) for obtaining task results for given period.
      edtu - is timestamp for end of interval. Should be greater than sdtu.
      Note0: (sdtu, edtu) defines interval
      Currently it is only used on quering results - results flag should be set in info parameter.
      Note1: timestamps are in UTC time zone
      Note2: number of queried results should not exceed 10000.
      We calculate number of requested results as:
      (edtu - sdtu) * (# queried tasks) / (Avg interval of queried tasks)
      If this number greater than 10000, the response will be 400: StartEndIntervalIsTooBig

    Response:

    200 OK:

    • Accept: application/json or Content-Type: application/json

      TODO

      Note0: if results are requested with info=results and (sdtu, edtu)
      response will contain array of results: [result1, result2, ...]
      Results are task type dependent.
      For sure they have:
      timestamp - int64, unix timestamp, UTC
      eventNumber - int32, sequential number of task check

    Examples:

    • Request for all tasks in json format:
    • json
      GET BASE_URL/tasks HTTP/1.1
      User-Agent: Fiddler
      Accept: application/json
      Host: www.host-tracker.com
      Authorization: bearer 3DD135...5EE510417
      Content-Length: 0
      
    • TODO

    POST BASE_URL/tasks/http

    create http task.

    Request headers:

    • Authorization: bearer your auth.token here (how to get token see user operations)

    Request body in json format:

    json
    {
      //fields specific for http task
      "url": "<your url. Required>",
      "httpMethod": "<Get, Post or Head. Optional - default is Get>",
      "userAgent": "<user agent for request. Optional.>",
      "referer": "<referrer for request. Optional>",
      "acceptHeader": "<accept header. Optional>",
      "followRedirect": <bool: true or false(default). Optional>,
      "treat300AsError": <bool: true or false(default). Optional. If set, followRedirect is ignored>,
        //if true then redirects will be followed.
      "checkDnsbl": <bool: true or false(default). Optional>,
        /*if true then domain will be checked agains DNS black lists and if it is there,
         notification will be send according to subscriptions.*/

      "checkDomainExpiration": <bool: true or false(default). Optional>,
        /*if true then domain expiration date will be monitored.
         Notifications will be sent 30,7 and 1 day before expiration and every day after it according to subscriptions.*/

        /*Note: expiration monitoring will be created only for valid domain (not IP)*/
      "checkCertificateExpiration": <bool: true or false(default). Optional>,
        /*if true then certificate expiration date of provided endpoint will be monitored.
         Notifications will be sent 30,7 and 1 day before expiration and every day after it according to subscriptions.
         Available only for https endpoints and ignored in other cases.*/

      "timeout": <int: ms for site response before fail. Optional>,
      "keywords":
        [
          "keyword1", "keyword2", ...
        ],
         //keywords to search for in response body. Optional
      "keywordMode": "<PresentAny, PresentAll, ReverseAny, ReverseAll, ReverseWithResult. Optional>",
       /*
      Keyword mode specifies how to use keywords:
    • PresentAny - task will be Ok if any of specified keywords are present in response
    • PresentAll - task will be Ok if all specified keywords are present in response
    • ReverseAny - task will be Ok if all specified keywords are absent in response
    • ReverseAll - task will be Ok if any of specified keywords are absent in response
    • ReverseWithResult - task will be Ok if all specified keywords are absent in response.
      Fail contains rest of response line where first keyword was detected.
      This text is sent in alerts. Usefull, for example, in scenarios when your response contains
      some status information - each line has error status and object with this status.
      In such case you will retrieve on email, SMS, ... information of objects with fail status.
      WARN. In this mode only first 100 characters of every response line will be analyzed.
      */

      "userName": "<userName for credentials to your resourse. Optional>",
      "password": "<password for credentials to your resourse. Optional>",
      "postParameters":"paramKey1=paramValue1\r\nparamKey2=paramValue2\r\n...", /*postParameters are Optional and specified with Post httpMethod*/
      //fields same for all task types
      "interval": <int: 1(default),5,15,30,60 - interval of monitoring. Optional>,
      "enabled": <bool: true(default) or false. Optional>,
      "fullLog": <bool: true or false(default). Optional>,
      "openStat": <bool: true(default) or false. Optional>,
      "name": "<your task name here. Optional>",
      "tags":
        [
          "tag1", "tag2", ...
        ], /*tags are Optional and can be used for task filtering*/
      "agentPools":
        [
          "poolId1", "poolId2", ...
        ], /*agentPools is Optional. It specifies monitoring locations for task. Default is taken from profile.
    Requirements if specified: 7 agents in all pools. If condition is not met error SelectMoreAgents with details will arise. */

      "subscriptions":
         [
            <subscription1>, <subscription2>, ...
         ]
      /*
        subscriptions are Optional. You could subscribe contacts for alerts and reports about this task using this field.
        In every subscription structure in array you should not specify taskIds. Specifying contactIds will create subscriptions only for this contacts.
        If you do not specify contactIds then all your existing confirmed contacts will be subscribed.
        For details of subscription structure see subscription service and examples.
      */

    }

    Response:

    201 Created:

    • Content-Type: application/json
    • json
      {
      "id":"ef10cd12-93f9-e311-bec5-dc85de1f0bc2",
      "url":"http://www.myprivateresource6.com",
      "rawUrl":"http://www.myprivateresource6.com",
      "name":"testing web api on private resourse",
      "creationTime":"2014-06-21T22:26:23.6780166Z",
      "taskType":"Http",
      "enabled":true,
      "interval":1,
      "upFromTime":"2014-06-21T22:26:23.6780166Z",
      "lastState":true,
      "lastStateChangeTime":"2014-06-21T22:26:23.6780166Z",
      "openStatEnabled":false,
      "fullLogEnabled":false,
      "disablenceReason":null,
      "disablenceTime":null,
      "holdResults":true,
      "agentStat":false,
      "billingOverlimits":[],
      "tags":["privateResource","testApi"],
      "subscriptions":
      [
      {
      "alertTypes":["Up"],
      "reportTypes":null,
      "taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],
      "contactIds":["4cedf037-d1d9-e311-bebc-dc85de1f0bc2"]
      },
      {
      "alertTypes":["Down"],
      "reportTypes":null,
      "taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],
      "contactIds":["4cedf037-d1d9-e311-bebc-dc85de1f0bc2"]
      },
      {
      "alertTypes":["Up"],
      "reportTypes":null,
      "taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],
      "contactIds":["afc5e2c8-3d42-e311-bea5-3085a980e898"]
      },
      {
      "alertTypes":["Down"],
      "reportTypes":null,
      "taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],
      "contactIds":["afc5e2c8-3d42-e311-bea5-3085a980e898"]
      },
      {
      "alertTypes":["Up"],"reportTypes":null,
      "taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],"contactIds":["e48409ff-bbf7-e311-bec5-dc85de1f0bc2"]},
      {"alertTypes":["Down"],"reportTypes":null,"taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],"contactIds":["e48409ff-bbf7-e311-bec5-dc85de1f0bc2"]},
      {"alertTypes":null,"reportTypes":["Monthly"],"taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],"contactIds":["4cedf037-d1d9-e311-bebc-dc85de1f0bc2"]},
      {"alertTypes":null,"reportTypes":["Daily"],"taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],"contactIds":["afc5e2c8-3d42-e311-bea5-3085a980e898"]},
      {"alertTypes":null,"reportTypes":["Monthly"],"taskIds":["ef10cd12-93f9-e311-bec5-dc85de1f0bc2"],"contactIds":["afc5e2c8-3d42-e311-bea5-3085a980e898"]}
      ],
      "stats":null,
      "agentPools":["asia","westeurope"],
      "deleted":false,
      "httpMethod":"Post",
      "userAgent":"mybot",
      "referer":"http://www.google.com",
      "acceptHeader":"application/json",
      "keywords":["error","wrong"],
      "keywordMode":"ReverseAny",
      "maxResponsePageSize":2097152,
      "timeout":40000,
      "userName":"public",
      "password":"xxx",
      "postParameters":"param1=test\r\nparam2=test\r\nuser=public"
      }

    Examples:

  • Content-Type: application/json
  • json
    POST BASE_URL/tasks/http HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 823
    Authorization: bearer ECFB190B3...653C1E78
    
    {
    "url": "http://www.myprivateresource.com",
    "httpMethod": "Post",
    "userAgent": "mybot",
    "referer": "http://www.google.com",
    "acceptHeader": "application/json",
    "keywords": ["error", "wrong"],
    "keywordMode": "ReverseAny",
    "timeout": 10000,
    "userName": "public",
    "password": "xxx",
    "postParameters":"param1=test\r\nparam2=test\r\nuser=public",
    "interval": 1,
    "enabled": true,
    "fullLog": false,
    "openStat": false,
    "name": "testing web api on private resourse",
    "tags": ["testApi", "privateResource"],
    "agentPools": ["asia", "westeurope"],
    "subscriptions":
    [
    {"alertTypes": ["Up", "Down"]},
    {"reportTypes": ["Daily"], contactIds:["AFC5E2C8-3D42-E311-BEA5-3085A980E898"]},
    {"reportTypes": ["Monthly"]}
    ]
    }
    

    POST BASE_URL/tasks/ping

    create ping task.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Parameters:

    • id - should only be specified in UpdateTasks method. Ignored in other methods.
    • enabled - if true task will be created in enabled state
    • interval - interval in minutes. See available intervals in GetTaskIntervals method
    • name - task name
    • fullLog - enable or disable full logging for task
    • openStat - is statistics and task results are public (available for public access)
    • tags - array of tags for task
    • agentPools - monitoring agents from which task should be monitored. Default is taken from profile.
      Requirements if specified: 7 agents in all pools. If condition is not met error SelectMoreAgents with details will arise.
    • subscriptions - array of Subscription. See subscription service for details
    • host - IP or domain name of target host

  • Content-Type: application/json
  • json
    POST BASE_URL/tasks/ping HTTP/
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 430
    Authorization: bearer your auth.token here
    
    {
        "interval": 1,
        "enabled": true,
        "fullLog": false,
        "openStat": false,
        "name": "testing web api on private resourse",
        "tags": ["testApi", "privateResource"],
        "agentPools": [],
        "subscriptions":
        [
            {"alertTypes": ["Up", "Down"]},
            {"reportTypes": ["Daily"], contactIds:[]},
            {"reportTypes": ["Monthly"]}
        ],
        "host":"91.197.255.62"
    }
    

    Response:

    • 201 Created
    • 401 AccessDenied - authorization header is not provided
    • 401 WrongTicket - wrong token provided in header
    • 401 TicketExpired - specified ticket expired

    POST BASE_URL/tasks/port

    create port task.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Parameters:

    • id - should only be specified in UpdateTasks method. Ignored in other methods.
    • enabled - if true task will be created in enabled state
    • interval - interval in minutes. See available intervals in GetTaskIntervals method
    • name - task name
    • fullLog - enable or disable full logging for task
    • openStat - is statistics and task results are public (available for public access)
    • tags - array of tags for task
    • agentPools - monitoring agents from which task should be monitored. Default is taken from profile.
      Requirements if specified: 7 agents in all pools. If condition is not met error SelectMoreAgents with details will arise.
    • host - IP or domain name of target host
    • port - port on the host

  • Content-Type: application/json
  • json
    
    POST BASE_URL/tasks/port HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer your auth.token here
    Content-Length: 400
    
    {
    "host":"my.some.site.com",
    "port":"123",
    "interval": 1,
    "enabled": true,
    "fullLog": false,
    "openStat": false,
    "name": "porttest2",
    "tags": ["tag1"],
    "agentPools": [],
    "subscriptions":
    [
    {"alertTypes": ["Up", "Down"]},
    {"reportTypes": ["Daily"], contactIds:["AFC5E2C8-3D42-E311-BEA5-3085A980E898"]},
    {"reportTypes": ["Monthly"]}
    ]
    }
    

    Response:

    • 201 Created
    • 401 AccessDenied - authorization header is not provided
    • 401 WrongTicket - wrong token provided in header
    • 401 TicketExpired - specified ticket expired

    PUT BASE_URL/tasks

    - update general task parameters.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

    • 200 - OK
    • WrongInterval - interval for task is not in range of available regular task intervals (see GetTaskIntervals method)
    • WrongEditableTaskDataType - type of task in db and type of input editable data is not the same.
    • DeniedAccessToMonitoringAgents - you could not set monitoring points for task by default. Contact us if you want to do this.
    • BadIP - bad ip specified in host or url
    • WrongUrl - url is wrong
    • UrlInBlackList - url is in black list
    • WrongHttpMethod - http method is wrong (see GetTask for allowed methods)
    • WrongKeywordMode - http task keyword mode is wrong (see GetTask for allowed modes)
    • WrongPort - port of port task is wrong
    • WrongTaskType - task type is wrong (see GetTaskTypes for allowed types)
    • WrongTaskStatus - allowed enabled and disabled values
    • SimilarExists - some of your tasks have same url or host or host:port specified
    • NoIdInTaskData - no id specified in task editable data
    • EmptyTaskData - array of editable task data is empty

    POST BASE_URL/tasks/port

    create port task.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Content-Type: application/json
  • json
    
    PUT BASE_URL/tasks/http/guid of task HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 659
    Authorization: bearer your auth.token here
    
    {
    "url": "http://www.myprivateresource.com",
    "httpMethod": "Post",
    "userAgent": "mybot",
    "referer": "http://www.google.com",
    "acceptHeader": "application/json",
    "keywords": ["error", "wrong"],
    "keywordMode": "ReverseAny",
    "userName": "public",
    "timeout": 5000,
    "password": "xxx",
    "postParameters":"param1=test\r\nparam2=test\r\nuser=public",
    "interval": 1,
    "enabled": true,
    "fullLog": false,
    "openStat": false,
    "name": "test33",
    "tags": [],
    "agentPools": [],
    "subscriptions":
    [
    {"alertTypes": ["Up", "Down"]},
    {"reportTypes": ["Daily"], contactIds:[]},
    {"reportTypes": ["Monthly"]}
    ]
    }
    

    Response:

    • 200 - OK
    • WrongInterval - interval for task is not in range of available regular task intervals (see GetTaskIntervals method)
    • WrongEditableTaskDataType - type of task in db and type of input editable data is not the same.
    • DeniedAccessToMonitoringAgents - you could not set monitoring points for task by default. Contact us if you want to do this.
    • BadIP - bad ip specified in host or url
    • WrongUrl - url is wrong
    • UrlInBlackList - url is in black list
    • WrongHttpMethod - http method is wrong (see GetTask for allowed methods)
    • WrongKeywordMode - http task keyword mode is wrong (see GetTask for allowed modes)
    • WrongPort - port of port task is wrong
    • WrongTaskType - task type is wrong (see GetTaskTypes for allowed types)
    • WrongTaskStatus - allowed enabled and disabled values
    • SimilarExists - some of your tasks have same url or host or host:port specified

    PUT BASE_URL/tasks/ping

    update ping task.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Content-Type: application/json
  • json
    
    PUT BASE_URL/tasks/ping/guid of task HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 344
    Authorization: bearer your auth.token here
    
    {
    "host":"91.197.255.62"
    "interval": 1,
    "enabled": true,
    "fullLog": false,
    "openStat": false,
    "name": "testing web api on private resourse",
    "tags": ["testApi", "privateResource"],
    "agentPools": [],
    "subscriptions":
    [
    {"alertTypes": ["Up", "Down"]},
    {"reportTypes": ["Daily"], contactIds:[]},
    {"reportTypes": ["Monthly"]}
    ],
    }
    

    Response:

    • 200 - OK
    • WrongInterval - interval for task is not in range of available regular task intervals (see GetTaskIntervals method)
    • WrongEditableTaskDataType - type of task in db and type of input editable data is not the same.
    • DeniedAccessToMonitoringAgents - you could not set monitoring points for task by default. Contact us if you want to do this.
    • BadIP - bad ip specified in host or url
    • WrongUrl - url is wrong
    • UrlInBlackList - url is in black list
    • WrongHttpMethod - http method is wrong (see GetTask for allowed methods)
    • WrongKeywordMode - http task keyword mode is wrong (see GetTask for allowed modes)
    • WrongPort - port of port task is wrong
    • WrongTaskType - task type is wrong (see GetTaskTypes for allowed types)
    • WrongTaskStatus - allowed enabled and disabled values
    • SimilarExists - some of your tasks have same url or host or host:port specified

    PUT BASE_URL/tasks/port

    update port task.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Content-Type: application/json
  • json
    
    PUT BASE_URL/tasks/port/guid of task HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 399
    Authorization: bearer your auth.token here
    
    {
    "host":"my.some.site.com",
    "port":"123",
    "interval": 1,
    "enabled": true,
    "fullLog": false,
    "openStat": false,
    "name": "porttest2",
    "tags": ["tag1"],
    "agentPools": [],
    "subscriptions":
    [
    {"alertTypes": ["Up", "Down"]},
    {"reportTypes": ["Daily"], contactIds:["AFC5E2C8-3D42-E311-BEA5-3085A980E898"]},
    {"reportTypes": ["Monthly"]}
    ]
    }
    

    Response:

    • 200 - OK
    • WrongInterval - interval for task is not in range of available regular task intervals (see GetTaskIntervals method)
    • WrongEditableTaskDataType - type of task in db and type of input editable data is not the same.
    • DeniedAccessToMonitoringAgents - you could not set monitoring points for task by default. Contact us if you want to do this.
    • BadIP - bad ip specified in host or url
    • WrongUrl - url is wrong
    • UrlInBlackList - url is in black list
    • WrongHttpMethod - http method is wrong (see GetTask for allowed methods)
    • WrongKeywordMode - http task keyword mode is wrong (see GetTask for allowed modes)
    • WrongPort - port of port task is wrong
    • WrongTaskType - task type is wrong (see GetTaskTypes for allowed types)
    • WrongTaskStatus - allowed enabled and disabled values
    • SimilarExists - some of your tasks have same url or host or host:port specified

    DELETE BASE_URL/tasks/{id:guid}

    delete task specified by id (GUID).

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

    TODO

    DELETE BASE_URL/tasks

    delete tasks by filter specified in query string.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Query string parameters (all are optional):

    • info - specify what additional task information to return.
      • subscriptions - return subscriptions (for alerts and reports) for task
      • stats - return statistics (daily, monthly, yearly, total) for task
      • results - return results for interval (sdtu, edtu) from query string.
        if (sdtu, edtu) is not provided - return last result for task.
        Results are returned as array in results field of task.
      Several values could be specified using comma. For ex.: info=stats,subscriptions.
      Also you could use int value for each flag:
      • subscriptions bit 0001 - 1
      • stats bit 0010 - 2
      • results bit 0100 - 4
      In such case info=stats,subscriptions,results is same to info=7(0111).
    • ids - return only tasks with ids specified in ids url parameter.
      If you search by one id - see method GET BASE_URL/tasks/{id:guid}
      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
    • urls - task with specified urls to search for. Url in urls array should be url encoded.
    • 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).
    • 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).
    • 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
    • sdtu - int64, unix timestamp, UTC - number of seconds from 01.01.1970.
      start time = (01.01.1970 00:00:00 + sdtu)
      See edtu and notes bellow.
    • edtu - int64, unix timestamp, UTC - number of seconds from 01.01.1970.
      end time = (01.01.1970 00:00:00 + edtu)
      In query string you need to provide both (sdtu, edtu) for obtaining task results for given period.
      edtu - is timestamp for end of interval. Should be greater than sdtu.
      Note0: (sdtu, edtu) defines interval
      Currently it is only used on quering results - results flag should be set in info parameter.
      Note1: timestamps are in UTC time zone
      Note2: number of queried results should not exceed 10000.
      We calculate number of requested results as:
      (edtu - sdtu) * (# queried tasks) / (Avg interval of queried tasks)
      If this number greater than 10000, the response will be 400: StartEndIntervalIsTooBig

    Response:

    TODO

    POST BASE_URL/tasks/$batch

    perform batched tasks creation and/or update.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response:

    TODO

    Api REST contact operations

    GET BASE_URL/contacts/types

    get array of accepted contact types.

    Request. GET BASE_URL/contacts/types

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response. GET BASE_URL/contacts/types

  • Content-Type: application/json
  • json
    
    ["Email","IM","SMS","VoiceCall"]
    

    GET BASE_URL/contacts/delays

    get array of accepted contact alert delays in minutes.

    Request. GET BASE_URL/contacts/types

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Response. GET BASE_URL/contacts/delays

  • Content-Type: application/json
  • json
    
    [0,5,15,30,60,180,720]
    

    GET /contacts/sms/gateways

    get array of accepted sms gateways.

    Request. GET BASE_URL/contacts/sms/gateways

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Response. GET BASE_URL/contacts/sms/gateways

  • Content-Type: application/json
  • json
    
    ["clickatell","clickatella","infobip","skype","twiliosms"]
    

    GET BASE_URL/contacts

    get all contacts, possible filltered by url query str

    Request. GET BASE_URL/contacts

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.

  • Optional filters(via URL,URL filter keywords are case sensitive!):

  • acceptBillingNotifications - True - search for contacts which accepts billing notifications, False - search only for contacts which does not accept billing notifications, Null - search both
  • json
    
    GET BASE_URL/contacts?acceptBillingNotifications=True HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • address - search for contacts with specified address.
  • json
    
    GET BASE_URL/contacts?address=test@mail.com HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • addresses - search for contacts with specified addresses
  • json
    
    GET BASE_URL/contacts?addresses=test@mail.com&addresses=1122334455 HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • contactType - search for specified contact type(SMS, Email, IM, VoiceCall).
  • json
    
    GET BASE_URL/contacts?contactType=SMS HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • confirmed - True - search for confirmed only, False - search only for not confirmed, null - search both.
  • json
    
    GET BASE_URL/contacts?confirmed=True HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • excludeAddresses - search for contacts with not specified addresses(not email)
  • json
    
    GET BASE_URL/contacts?addresses=3333333334&addresses=222222221&addresses="gord_den+5@gmail.com"&excludeAddresses=True HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • excludeContactTypes - if true - exclude specified contact types
  • excludeIds - if true then exclude specified ids
  • ids - search contacts by ids
  • json
    
    GET BASE_URL/contacts?ids=092a2bc9-58d1-e411-80c3
    -00155d36955e&ids=695dc35a-59d1-e411-80c3-00155d36955e HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    
  • overlimited - True - search for overlimited only, False - search only for not overlimited, Null - search both
  • json
    
    GET BASE_URL/contacts?overlimited=False HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer <your token here>
    

    Response. GET BASE_URL/contacts

    contact data

  • Content-Type: application/json
  • json
    
    {
    "id":"Contact id",
    "address":"Contact address",
    "confirmed":"True or false",
    "contactType":"Type of contact",
    "name":"Name of contact",
    "sendCost":"Cost to send",
    "alertDelay":"Delay of alert",
    "activePeriodStart":"Start of active period",
    "activePeriodEnd":"End of active period",
    "activeDays":"Active days",
    "billingOverlimit":"Billing overlimit here",
    "subscriptions":"Subscriptions here",
    "reportFormat":"Format of report",
    "sendNews":"True or false",
    "sendPressRelease":"True or false",
    "sendBillingNotifications":"True or false"
    }
    

    GET BASE_URL/contacts/{id:guid}

    get contact by id (GUID)

    Request. GET BASE_URL/contacts/{id:guid}

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • json
    
    GET BASE_URL/contacts/092a2bc9-58d1-e411-80c3-00155d36955e HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 0
    Authorization: bearer
    

    GET BASE_URL/contacts/{id:guid}

    Contact data

    POST BASE_URL/contacts/email

    create email contact

    Request. POST BASE_URL/contacts/email

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

    • id - contact id (GUID) should be specified only in UpdateContacts operation. For other method should be null (not set).
    • name - user provided contact name
    • address - contact address
    • alertDelay - alert sending delay in minutes. See GetAlertDelays method for available values
    • activePeriodStart - string in format hh:mm (or null if contact is active for all time), specify start of contact daily activity period. Should be specified with activePeriodEnd. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activePeriodEnd - string in format hh:mm (or null if contact is active for all time), specify period of contact activity. Should be specified with activePeriodStart. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activeDays - array of week days when contact is active or null if contact is active for all days. Available values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
    • subscriptions - subscriptions for this contact (see subscription service AddSubscriptions for details).
    • reportFormat - format of emails. Currently supported: Text, ShortText. Planned: HTML, Pdf(for reports)
    • sendNews - could contact be used for news delivery
    • sendPressRelease - could contact be used for press release delivery
    • sendBillingNotifications - send billing notifications (about low balance, overlimits and others)
  • Content-Type: application/json
  • json
    
    {"address":"example@example.com","name":"name of you contact"}
    

    Response. POST BASE_URL/contacts/email

    Contact statuses:

    • Confirmed - contact created in confirmed state.
    • LowSmsBalance - could not send contact confirmation code due to low balance.
    • CodeSent - contact created and confirmation code was sent. Contact become active after confirmation.
    • CodeFail - contact create but code sending failed. Try to resend code after some time.
    • CodeSentEarlier -
    • OperationError -
    • Overlimited -

    POST BASE_URL/contacts/email

    create email contact

    Request. POST BASE_URL/contacts/email

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

    • id - contact id (GUID) should be specified only in UpdateContacts operation. For other method should be null (not set).
    • name - user provided contact name
    • address - contact address
    • alertDelay - alert sending delay in minutes. See GetAlertDelays method for available values
    • activePeriodStart - string in format hh:mm (or null if contact is active for all time), specify start of contact daily activity period. Should be specified with activePeriodEnd. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activePeriodEnd - string in format hh:mm (or null if contact is active for all time), specify period of contact activity. Should be specified with activePeriodStart. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activeDays - array of week days when contact is active or null if contact is active for all days. Available values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
    • subscriptions - subscriptions for this contact (see subscription service AddSubscriptions for details).
    • reportFormat - format of emails. Currently supported: Text, ShortText. Planned: HTML, Pdf(for reports)
    • sendNews - could contact be used for news delivery
    • sendPressRelease - could contact be used for press release delivery
    • sendBillingNotifications - send billing notifications (about low balance, overlimits and others)
  • Content-Type: application/json
  • json
    
    {"address":"number","name":"name of you contact","gateway":"type of gateway"}
    

    Response. POST BASE_URL/contacts/email

    Contact statuses:

    Contact data

    POST BASE_URL/contacts/im

    create instant messaging contact

    Request. POST BASE_URL/contacts/im

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

    • id - contact id (GUID) should be specified only in UpdateContacts operation. For other method should be null (not set).
    • name - user provided contact name
    • address - contact address
    • alertDelay - alert sending delay in minutes. See GetAlertDelays method for available values
    • activePeriodStart - string in format hh:mm (or null if contact is active for all time), specify start of contact daily activity period. Should be specified with activePeriodEnd. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activePeriodEnd - string in format hh:mm (or null if contact is active for all time), specify period of contact activity. Should be specified with activePeriodStart. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activeDays - array of week days when contact is active or null if contact is active for all days. Available values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
    • subscriptions - subscriptions for this contact (see subscription service AddSubscriptions for details).
    • reportFormat - format of emails. Currently supported: Text, ShortText. Planned: HTML, Pdf(for reports)
    • sendNews - could contact be used for news delivery
    • sendPressRelease - could contact be used for press release delivery
    • sendBillingNotifications - send billing notifications (about low balance, overlimits and others)
  • Content-Type: application/json
  • json
    
    {"address":"123api", "name":"im contact","gateway":"SkypeChat"}
    

    Response. POST BASE_URL/contacts/email

    Contact statuses:

    Contact data

    POST BASE_URL/contacts/voice

    create voice call contact

    Request. POST BASE_URL/contacts/voice

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

    • id - contact id (GUID) should be specified only in UpdateContacts operation. For other method should be null (not set).
    • name - user provided contact name
    • address - contact address
    • alertDelay - alert sending delay in minutes. See GetAlertDelays method for available values
    • activePeriodStart - string in format hh:mm (or null if contact is active for all time), specify start of contact daily activity period. Should be specified with activePeriodEnd. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activePeriodEnd - string in format hh:mm (or null if contact is active for all time), specify period of contact activity. Should be specified with activePeriodStart. If activePeriodStart > activePeriodEnd then activity period calculated as period from activePeriodStart day time to the end of the day plus period from next day start to next day activePeriodEnd time. If alert created when contact is outside activity period then it will not be sent to this contact.
    • activeDays - array of week days when contact is active or null if contact is active for all days. Available values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
    • subscriptions - subscriptions for this contact (see subscription service AddSubscriptions for details).
  • Content-Type: application/json
  • json
    
    {
    "address":"123123123",
    "name":"voice contact",
    "gateway":"twiliovoice"
    }
    

    Response. POST BASE_URL/contacts/email

    Contact statuses:

    Contact data

    PUT BASE_URL/contacts/email

    update email contact

    Request. PUT BASE_URL/contacts/email

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

  • Content-Type: application/json
  • json
    
    PUT BASE_URL/contacts/email/id of contact HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer your ticket here
    
    {"reportFormat":"ShortText"}
    

    Response. POST BASE_URL/contacts/email

    Contact statuses:

    Contact data

    PUT BASE_URL/contacts/sms

    update sms contact

    Request. PUT BASE_URL/contacts/email

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

  • Content-Type: application/json
  • json
    
    {"address":"222222221","name":"sms contact2","gateway":"twiliosms"}
    

    Response. POST BASE_URL/contacts/sms

    Contact data

    PUT BASE_URL/contacts/im

    update instant messaging contact

    Request. PUT PUT BASE_URL/contacts/im

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

  • Content-Type: application/json
  • json
    
    PUT BASE_URL/contacts/im/695dc35a-59d1-e411-80c3-00155d36955e HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer
    Content-Length: 79
    {"address":"222222224","name":"im contact2","gateway":"GTalk"}
    

    Response. PUT PUT BASE_URL/contacts/im

    Contact data

    PUT BASE_URL/contacts/voice

    Currently has no additional field. VoiceCall gateway is twiliovoice. Send cost: $0.04 for US carriers, $0.222 for other.

    DELETE BASE_URL/contacts/{id:guid}

    delete contact specified by id (GUID)

    Request. DELETE BASE_URL/contacts/{id:guid}

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json
  • json
    
    DELETE BASE_URL/contacts/id of contact HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer your ticket here
    

    Response. PUT PUT BASE_URL/contacts/im

    Contact data

    DELETE BASE_URL/contacts

    delete contacts specified by filter or all contacts

    Request.

    Response

    POST /contacts/{id:guid}/code

    confirm contact by sending confirmation code

    Request. POST BASE_URL/contacts/{id:guid}/code

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Parameters:

  • Content-Type: application/json
  • json
    
    POST BASE_URL/contacts/id of contact/code HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Authorization: bearer your token here
    
    {"code":"64700"}
    

    Response. PUT PUT BASE_URL/contacts/im

    Contact data

    PATCH /contacts/{id:guid}/code

    possible regenerate confirmation code and resend it to contact address

    Request. PATCH BASE_URL/contacts/{id:guid}/code

    Headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Accept specifies response content format: application/json.
  • Response. PATCH /contacts/{id:guid}/code

    Contact data

    Api REST stats operations

    GET BASE_URL/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)
  • Query string parameters (inherited from task filter):

    • ids - return only tasks with ids specified in the ids URL parameter.
      For specifying many ids use this example: ?ids=guid1&ids=guid2&ids=guid3.
    • excludeIds - exclude ids specified in the ids array and return other tasks. ?excludeIds=true
    • taskType - task type to search for. ?taskType=Http (case sensitive)
    • taskTypes - array of task types 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. The URL should be specified.
    • urls - task with specified URLs to search for. The URL in the URLs array should be URL encoded.
    • urlSearchLike - specified only with URL parameter (not URLs). If true, like search will be performed.
      ?url=mysite&urlSearchLike=true - will return tasks with URLs like http://www.mysite.com/some/file.js, http://www.mysite.com and others which contain "mysite".
    • excludeUrls - exclude tasks with specified URLs (in URL and URLs parameter).
    • name - search for a task with the specified name.
      If name (names) and id (ids) are specified in the URL query string - search will use OR join for results.
      For example, ?id=guid1&name=mytask will return tasks with the name "mytask" and the task with the id "guid1".
      Combining name (names) with other filter parameters will result in an AND join - all returned tasks should contain the name as specified in the name (names) parameter.
    • names - array of names to search for. ?names=mytask1&names=mytask2
    • nameSearchLike - perform a like search for the name (cannot be used with names). ?name=mytask&nameSearchLike=true
    • excludeNames - exclude tasks with specified names (names).
    • interval - search tasks with the 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.
      Tasks could be disabled by the HostTracker system or by the user.
      This flag indicates system disablance (due to overlimit, low balance, or other).
      For user disablance, see the 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 has no effect if you also specify statsStartUnix in the query string.
      Instead, the start date will be calculated from statsStartUnix. If both statsStart and statsStartUnix are empty
      then startDate will be chosen as the minimum from creation times of tasks selected by the filter.
      Important: dates you provide in one of the 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 has no effect if you also specify statsEndUnix in the query string.
      Instead, the 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 the 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 the query string, you usually provide a pair (statsStartUnix, statsEndUnix) or a pair (statsStart, statsEnd).
      Important: dates you provide in one of the 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 the query string, you usually provide a pair (statsStartUnix, statsEndUnix) or a pair (statsStart, statsEnd).
      Important: dates you provide in one of the parameters (statsStart, statsEnd, statsStartUnix, statsEndUnix)
      are treated as time in UTC time zone.
    • expectedSLA - value between 0.00 and 100.00. Expected SLA.
      if the calculated uptime % is less than expectedSLA then in the results field slaExpectationSucceeded will be false
      In other cases, the value in slaExpectationSucceeded will be true.
      If you do not provide expectedSLA in the request or the task does not have data for detecting practical uptime %, slaExpectationSucceeded will be absent in the response
    • fullTask - true or false (default is false). If true then all task information will be returned in the task field of StatsForTask object
      In other cases (when false or not specified in the query string) just a TaskReference object will be returned. It contains only the id and name field of the 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 availability verifications) that resulted in up state.
    • downtimeChecks - number of checks (site availability verifications) that resulted in down state (site was not accessible or error occurred).
    • maintenanceUptimeChecks - number of checks (site availability verifications) that resulted in up state during maintenance.
    • maintenanceDowntimeChecks - number of checks (site availability verifications) that resulted in down state during maintenance.
    • totalChecks - number of checks (site availability 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 parameter 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.

    Api REST outage operations

    GET BASE_URL/outages

    get outages for tasks

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • 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
    • urls - task with specified urls to search for. Url in urls array should be url encoded.
    • 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).
    • 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).
    • 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 outage 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 outages.
      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 outages 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: Outages object with taskOutages property - array of TaskOutages objects. Outages object fields:

    • startTime - string, formated according to profile DateTime format settings.
      Shows startTime query filter parameter, that was used for obtained outages
      It is returned always, even if you do not specify it in OutageFilter
    • endTime - string, formated according to profile DateTime format settings.
      Shows endTime query filter parameter, that was used for obtained outages
      It is returned always, even if you do not specify it in OutageFilter
    • 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 outages and query filter parameters
      Equals to UTC if getInUtcTimeZone is 1 in filter
    • taskOutages - Array of information about tasks.
      Each element contains two fields:
      • task - TaskReference (or Task if fullTask is true in request)
      • outages - Array of Span objects

    Span object fields:

    • startTime - string, formated according to profile DateTime format settings.
      It is a start time of outage
    • endTime - string, formated according to profile DateTime format settings.
      It is an end time of outage
    • startTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
      It is a start time of outage
    • endTimeUnix - big int (or long) - seconds from 01.01.1970 00:00:00
      It is an end time of outage
    • startEventNumber - int
      Number of check (in a sequence of task availability checks) which detected that site went DOWN
    • endEventNumber - int
      Last number of check (in a sequence of task availability checks) which detected that site was still DOWN before UP
    • comment - string
      Comment for outage you provided in Host-Tracker web UI.

    Api REST incident operations

    GET BASE_URL/incident

    get incidents for tasks.

    Request headers:

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • 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
    • urls - task with specified urls to search for. Url in urls array should be url encoded.
    • 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).
    • 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).
    • 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[]

    Operations with monitoring locations

    GET /agents

    get array of HostTracker world monitoring points

    Request. GET BASE_URL/agents

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response. GET BASE_URL/agents

    200 OK:

  • Accept: application/json or Content-Type: application/json
  • Json:
    
    [
    {
    "id":"guid - monitoring point id",
    "upFrom":"date - monitoring point starting date",
    "datacenter":
    {
    "name":"datacenter name",
    "city":"datacenter city",
    "country":"datacenter country",
    "state":"datacenter state"
    },
    "company":
    {
    "url":"company site",
    "name":"company name",
    "language":"company site language",
    "country":"company country"
    },
    "ip":"agent ip address",
    "version":"agent version",
    "lon":agent longitude, ex. -97.14667,
    "lat":agent latitude, ex. 31.549333,
    "pools":[array of pools, currently empty. reserved for future use]
    },
    {
    "id":"5625d028-7c78-482f-9d8d-2c41fbc752f1",
    "upFrom":"2013-04-17T15:02:38",
    "datacenter":
    {
    "name":"Waco ITG",
    "url":"http://guiahosting.com",
    "city":"Waco",
    "country":"US",
    "state":"TX"
    },
    "company":
    {
    "name":"GuiaHosting",
    "language":"ES",
    "country":"US"
    },
    "ip":"91.197.251.251",
    "version":"0.0.5230.0",
    "lon":-98.14667,
    "lat":33.549333,
    "pools":[]
    }
    ...
    ]
    
    • 401 AccessDenied - authorization header is not provided
    • 401 WrongTicket - wrong token provided in header
    • 401 TicketExpired - specified ticket expired

    Examples. GET BASE_URL/agents

  • Request for agents in json format:
  • Json
    GET BASE_URL/agents HTTP/1.1
    User-Agent: Fiddler
    Accept: application/json
    Host: www.host-tracker.com
    Authorization: bearer 3DD135...5EE510417
    Content-Length: 0
    

    GET BASE_URL/agents/pools

    - get array of agent regions (Asia, Europe, America) (used for configuring tasks)

    Request. GET BASE_URL/agents/pools

  • Authorization: bearer <your auth.token here> (how to get token see user operations)
  • Response. GET BASE_URL/agents/pools

    200 OK:

  • Accept: application/json or Content-Type: application/json
  • json
    [
        {
            "id":"string - id of region",
            "desc":"readable region description",
            "hidden":false,
            "childPools":["child1 pool id", "child1 pool id", ... ],
            "agents":["array of this region agents"],
        },
        ...
    ]
    

    Examples. GET BASE_URL/agents/pools

  • Request for agent pools in json format:
  •  
    GET BASE_URL/agents/pools HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 0
    Authorization: bearer ECFB190B3...653C1E78