HostTracker API. User operations

  1. POST /api/web/v1/users/token - get authorization token for requests to other API. request response examples
POST /api/web/v1/users/token - get authorization token for requests to other API
Request. POST /api/web/v1/users/token
  • Content-Type: application/json {"login":"your login here", "password":"your password here"} Parameters should be js encoded.
  • 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 /api/web/v1/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 /api/web/v1/users/token
  • Json request for json token: POST https://www.host-tracker.com/api/web/v1/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 https://www.host-tracker.com/api/web/v1/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 https://www.host-tracker.com/api/web/v1/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 https://www.host-tracker.com/api/web/v1/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