HostTracker help - api REST user operations

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

  1. POST BASE_URL/users/token - get authorization token for requests to other API. request response examples
POST BASE_URL/users/token - get authorization token for requests to other API
Request. POST BASE_URL/users/token
  • Content-Type: application/json {"login":"your login here", "password":"your password here"} Parameters should be js encoded.
  • Subaccount could work with superaccount data by providing "forLogin" field. Content-Type: application/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.
  • Content-Type: text/xml <LoginData>
       <login>your login here</login>
       <password>your password here</password>
    </LoginData>
    Parameters should be xml encoded.
  • Content-Type: application/x-www-form-urlencoded login=your login here&password=your password here Parameters should be url encoded.
  • Accept specifies response content format: application/json, text/xml.
    It is optional and if omitted then response format detected from Content-Type.
    For Content-Type: application/x-www-form-urlencoded it is application/json by default.
  • Authorization should not be send.
Response. POST BASE_URL/users/token
  • 200 OK:
    • Accept: application/json (or if not specified and Content-Type is not xml) {
         "ticket":"your token here",
         "expirationTime":"token expiration",
         "expirationUnixTime":int value - token expiration unix time
      }
    • Accept: text/xml (or if not specified and Content-Type is xml) <AuthTicket>
         <ticket>your token here</ticket>
         <expirationTime>token expiration</expirationTime>
         <expirationUnixTime>int value - token expiration unix time</expirationUnixTime>
      </AuthTicket>
      Parameters should be xml encoded.
  • 401 IncorrectLoginOrPassword - incorect login or password
Examples. POST BASE_URL/users/token
  • Json request for json token: POST BASE_URL/users/token HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: www.host-tracker.com
    Content-Length: 37

    {"login":"login", "password":"password"}
  • XML request for XML token: POST BASE_URL/users/token HTTP/1.1
    User-Agent: Fiddler
    Content-Type: text/xml
    Host: www.host-tracker.com
    Content-Length: 75

    <LoginData>
    <login>login</login>
    <password>password</password>
    </LoginData>
  • Form request for json token: POST BASE_URL/users/token HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/x-www-form-urlencoded
    Host: www.host-tracker.com
    Content-Length: 26

    login=login&password=password
  • Form request for XML token: POST BASE_URL/users/token HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/x-www-form-urlencoded
    Accept: text/xml
    Host: www.host-tracker.com
    Content-Length: 26

    login=login&password=password

Help pages by categories