HostTracker help - api REST task operations

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

  1. GET BASE_URL/tasks/intervals - get array of accepted task intervals. Currently accepted [1,5,15,30,60].
  2. 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
  3. GET BASE_URL/tasks/{id:guid} - get task by id (GUID). request response examples
  4. GET BASE_URL/tasks - get all tasks or filtered via query string parameters. request response examples
  5. POST BASE_URL/tasks/http - create http task. request response examples
  6. POST BASE_URL/tasks/ping - create ping task. request response examples
  7. POST BASE_URL/tasks/port - create port task. request response examples
  8. PUT BASE_URL/tasks - update general task parameters. request response examples
  9. PUT BASE_URL/tasks/http - update http task. request response examples
  10. PUT BASE_URL/tasks/ping - update ping task. request response examples
  11. PUT BASE_URL/tasks/port - update port task. request response examples
  12. DELETE BASE_URL/tasks/{id:guid} - delete task specified by id (GUID). request response examples
  13. DELETE BASE_URL/tasks - delete tasks by filter specified in query string. request response examples
  14. POST BASE_URL/tasks/$batch - perform batched tasks creation and/or update. request response examples
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)
Accept or Content-Type specifies response content format: application/json, text/xml.
GET BASE_URL/tasks/intervals HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 0
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)
Accept or Content-Type specifies response content format: application/json, text/xml.
GET BASE_URL/tasks/types HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 0
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)
Accept or Content-Type specifies response content format: application/json, text/xml.
GET BASE_URL/tasks/428cad60-2f47-e511-80c3-0003ff730224 HTTP/1.1
User-Agent: Fiddler
Content-Type: application/json
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 0
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)
  • Accept or Content-Type specifies response content format: application/json, text/xml.
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 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
  • 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, try API or see Create request bellow. 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
    • Accept: text/xml or Content-Type: text/xml TODO
  • 401 AccessDenied - authorization header is not provided
  • 401 WrongTicket - wrong token provided in header
  • 401 TicketExpired - specified ticket expired
Examples:
  • Request for all tasks in json format: 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)
  • Content-Type specifies request content format: application/x-www-form-urlencoded, application/json, text/xml.
  • Accept(or if not set - Content-Type) specifies response content format: application/json, text/xml.
Request body in json format: {
  //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.
  */

}
Request body in xml format: <HttpTaskEditableData>
  <!-- specific for http task fields -->
  <url>your url. Required</url>
  <httpMethod>Get, Post or Head. Optional - default is Get</httpMethod>
  <userAgent>user agent for request. Optional.</userAgent>
  <referer>referrer for request. Optional</referer>
  <acceptHeader>accept header. Optional</acceptHeader>
  <followRedirect>bool: true or false(default). Optional</followRedirect>
  <treat300AsError>bool: true or false(default). Optional. If set, followRedirect is ignored</treat300AsError>
    <!--if true then redirects will be followed.-->
  <checkDnsbl>bool: true or false(default). Optional</checkDnsbl>
    <!--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</checkDomainExpiration>
    <!--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</checkCertificateExpiration>
    <!--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.-->

  <keywords>
    <string>keyword1</string>
    <string>keyword2</string>
    ...
  </keywords>
  <!--keywords to search for in response body. Optional-->
  <keywordMode>PresentAny, PresentAll, ReverseAny, ReverseAll, ReverseWithResult. Optional</keywordMode>
   <!--
  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</userName>
  <password>password for credentials to your resourse. Optional</password>
  <postParameters>param1=test\r\nparam2=test\r\nuser=public</postParameters> <!--postParameters are Optional and specified with Post httpMethod-->
  <interval>1(default),5,15,30,60 - interval of monitoring. Optional</interval>
  <enabled>bool: true(default) or false. Optional</enabled>
  <fullLog>bool: true or false(default). Optional</fullLog>
  <openStat>bool: true(default) or false. Optional</openStat>
  <name>your task name here. Optional</name>
  <tags>
    <string>tag1</string>
    <string>tag2</string>
    ...
  </tags><!--tags are Optional and can be used for task filtering-->
  <agentPools>
    <string>poolId1</string>
    <string>poolId2</string>
    ...
  </agentPools><!--agentPools are 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>
    <Subscription>subscription1</Subscription>
    <Subscription>subscription2</Subscription>
    ...
  </subscriptions>
  <!--
    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.
  -->

</HttpTaskEditableData>
Response:
  • 201 Created:
    • Content-Type: application/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"
      }
    • If requested text/xml as response format
  • 401 AccessDenied - authorization header is not provided
  • 401 WrongTicket - wrong token provided in header
  • 401 TicketExpired - specified ticket expired
Examples:
  • Content-Type: application/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"]}
        ]
    }
  • Content-Type: text/xml
    POST BASE_URL/tasks/http HTTP/1.1
    User-Agent: Fiddler
    Content-Type: text/xml
    Accept: text/xml
    Host: www.host-tracker.com
    Content-Length: 1546
    Authorization: bearer ECFB...1E78

    <HttpTaskEditableData>
      <url>http://www.myprivateresource5.com</url>
      <httpMethod>Post</httpMethod>
      <userAgent>mybot</userAgent>
      <referer>http://www.google.com</referer>
      <acceptHeader>application/json</acceptHeader>
      <keywords>
        <string>error</string>
        <string>wrong</string>
      </keywords>
      <keywordMode>ReverseAny</keywordMode>
      <userName>public</userName>
      <password>xxx</password>
      <postParameters>param1=test\r\nparam2=test\r\nuser=public</postParameters>
      <interval>1</interval>
      <enabled>true</enabled>
      <fullLog>false</fullLog>
      <openStat>false</openStat>
      <name>testing web api on private resourse</name>
      <tags>
        <string>testApi</string>
        <string>privateResource</string>
      </tags>
      <agentPools>
        <string>asia</string>
        <string>westeurope</string>
      </agentPools>
      <subscriptions>
        <Subscription>
          <alertTypes>
            <string>Up</string>
            <string>Down</string>
          </alertTypes>
        </Subscription>
        <Subscription>
          <reportTypes>
            <string>Daily</string>
          </reportTypes>
          <contactIds>
            <guid>AFC5E2C8-3D42-E311-BEA5-3085A980E898</guid>
          </contactIds>
        </Subscription>
        <Subscription>
          <reportTypes>
            <string>Monthly</string>
          </reportTypes>
        </Subscription>
      </subscriptions>
    </HttpTaskEditableData>
POST BASE_URL/tasks/ping - create ping task.
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.
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
POST BASE_URL/tasks/ping HTTP/1.1
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"
}

Content-Type: text/xml POST BASE_URL/tasks/ping HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Content-Length: 773
Authorization: bearer your auth.token here
<PingTaskEditableData>
  <host>172.16.254.1</host>
  <interval>1</interval>
  <enabled>true</enabled>
  <fullLog>false</fullLog>
  <openStat>false</openStat>
  <name>test2</name>
  <tags>
    <string>tag1</string>
    <string>tag2</string>
  </tags>
  <agentPools>
  </agentPools>
  <subscriptions>
    <Subscription>
      <alertTypes>
        <string>Up</string>
        <string>Down</string>
      </alertTypes>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Daily</string>
      </reportTypes>
      <contactIds>
      </contactIds>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Monthly</string>
      </reportTypes>
    </Subscription>
  </subscriptions>
</PingTaskEditableData>
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)
  • Accept or Content-Type specifies response content format: application/json, text/xml.
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
  • port - port on the host
Content-Type: application/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"]}
    ]
}

Content-Type: text/xml POST BASE_URL/tasks/port HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 857

<PortTaskEditableData >
  <host>somemy.site.com</host>
  <port>123</port>
  <interval>1</interval>
  <enabled>true</enabled>
  <fullLog>false</fullLog>
  <openStat>false</openStat>
  <name>test2</name>
  <tags>
    <string>tag1</string>
    <string>tag2</string>
  </tags>
  <agentPools>
  </agentPools>
  <subscriptions>
    <Subscription>
      <alertTypes>
        <string>Up</string>
        <string>Down</string>
      </alertTypes>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Daily</string>
      </reportTypes>
      <contactIds>
        <guid>AFC5E2C8-3D42-E311-BEA5-3085A980E898</guid>
      </contactIds>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Monthly</string>
      </reportTypes>
    </Subscription>
  </subscriptions>
</PortTaskEditableData >
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)
  • Content-Type: specifies request content format: application/json, text/xml.
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
PUT BASE_URL/tasks/http - update http task.
Request headers:
  • Authorization: bearer your auth.token here (how to get token see user operations)
  • Content-Type specifies request content format: application/json, text/xml.
Content-Type: application/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"]}
    ]
}

Content-Type: text/xml
PUT BASE_URL/tasks/http/guid of task HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Content-Length: 1190
Authorization: bearer your auth.token here

<HttpTaskEditableData>
  <url>http://www.myprivateresource6.com</url>
  <httpMethod>Post</httpMethod>
  <userAgent>mybot</userAgent>
  <referer>http://www.google.com</referer>
  <acceptHeader>application/json</acceptHeader>
  <keywords>
    <string>error</string>
    <string>wrong</string>
  </keywords>
  <keywordMode>ReverseAny</keywordMode>
  <userName>public</userName>
  <password>xxx</password>
  <postParameters>param1=test\r\nparam2=test\r\nuser=public</postParameters>
  <interval>1</interval>
  <enabled>true</enabled>
  <fullLog>false</fullLog>
  <openStat>false</openStat>
  <name>testing web api on private resourse</name>
  <tags>
  </tags>
  <agentPools>
  </agentPools>
  <subscriptions>
    <Subscription>
      <alertTypes>
      <string>Up</string>
      <string>Down</string>
      </alertTypes>
    </Subscription>
    <Subscription>
      <reportTypes>
      <string>Daily</string>
      </reportTypes>
      <contactIds>
      </contactIds>
    </Subscription>
    <Subscription>
      <reportTypes>
      <string>Monthly</string>
      </reportTypes>
    </Subscription>
  </subscriptions>
</HttpTaskEditableData>
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 specifies request content format: application/json, text/xml.

Content-Type: application/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"]}
  ],
}

Content-Type: text/xml
PUT BASE_URL/tasks/ping/guid of task HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Content-Length: 638
Authorization: bearer your auth.token here

<PingTaskEditableData>
  <host>172.16.254.2</host>
  <interval>1</interval>
  <enabled>true</enabled>
  <fullLog>false</fullLog>
  <openStat>false</openStat>
  <name>test2</name>
  <tags>
    <string>tag1</string>
    <string>tag2</string>
  </tags>
  <agentPools>
  </agentPools>
  <subscriptions>
    <Subscription>
      <alertTypes>
      <string>Up</string>
      <string>Down</string>
      </alertTypes>
    </Subscription>
    <Subscription>
      <reportTypes>
      <string>Daily</string>
      </reportTypes>
      <contactIds>
      </contactIds>
    </Subscription>
    <Subscription>
      <reportTypes>
      <string>Monthly</string>
      </reportTypes>
    </Subscription>
  </subscriptions>
</PingTaskEditableData>
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 specifies request content format: application/json, text/xml.

Content-Type: application/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"]}
    ]
}

Content-Type: text/xml
PUT BASE_URL/tasks/port/guid of task HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Content-Length: 857
Authorization: bearer your auth.token here

<PortTaskEditableData>
  <host>somemy.site.com</host>
  <port>123</port>
  <interval>1</interval>
  <enabled>true</enabled>
  <fullLog>false</fullLog>
  <openStat>false</openStat>
  <name>test2</name>
  <tags>
    <string>tag1</string>
    <string>tag2</string>
  </tags>
  <agentPools>
  </agentPools>
  <subscriptions>
    <Subscription>
      <alertTypes>
        <string>Up</string>
        <string>Down</string>
      </alertTypes>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Daily</string>
      </reportTypes
      <contactIds>
        <guid>AFC5E2C8-3D42-E311-BEA5-3085A980E898</guid>
      </contactIds>
    </Subscription>
    <Subscription>
      <reportTypes>
        <string>Monthly</string>
      </reportTypes>
    </Subscription>
  </subscriptions>
</PortTaskEditableData>
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)
  • Content-Type specifies request content format: application/json, text/xml.
DELETE BASE_URL/tasks/guid of task HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Authorization: bearer your auth.token here
Content-Length: 0
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)
  • Content-Type specifies request content format: application/json, text/xml.
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
    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
    In such case info=stats,subscriptions is same to info=3(0011).
  • 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 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

DELETE BASE_URL/tasks?tag=tag1&?taskTypes=Http HTTP/1.1
User-Agent: Fiddler
Content-Type: text/xml
Host: www.host-tracker.com
Content-Length: 0
Authorization: bearer your auth.token here
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)
  • Content-Type specifies request content format: application/json, text/xml.
Response: TODO

Help pages by categories