AuthenticationGetUser

GetUser

Security service 1.2: Returns the calling user's employee ID, initials, name, UI language and roles.

ServiceSecurity 1.2
EndpointPOST https://app{server-number}.timelog.com/{account}/WebServices/Security/V1_2/SecurityServiceSecure.svc
SOAPActionGetUserRequest
Content-Typetext/xml; charset=utf-8
AuthenticationA token from GetToken
PermissionsNo privilege is needed and none is checked. Nothing about other users is reachable: there is no user parameter.
Changes dataNo
Safe to retryYes

How it works

"Who am I" for a token. Returns one User: the employee ID, initials, first and last name, UI language and security roles. It takes no user argument and cannot read anyone else. Useful right after GetToken to confirm the integration user and to obtain its EmployeeID / initials for operations that need them.

Parameters

Each parameter has one label: Required, Conditional (required depending on other values) or Optional. Send them in the order shown.

tokenSecurityToken
Required

The token from GetToken: Initials, Expires and Hash, sent back unchanged.

Request

POST /{account}/WebServices/Security/V1_2/SecurityServiceSecure.svc HTTP/1.1
Host: app{server-number}.timelog.com
Content-Type: text/xml; charset=utf-8
SOAPAction: "GetUserRequest"

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:security="http://www.timelog.com/api/tlp/v1_2">
  <soapenv:Body>
    <security:GetUser>
      <security:token>
        <security:Initials>{Initials from GetToken}</security:Initials>
        <security:Expires>{Expires from GetToken, unchanged}</security:Expires>
        <security:Hash>{Hash from GetToken}</security:Hash>
      </security:token>
    </security:GetUser>
  </soapenv:Body>
</soapenv:Envelope>
Replace every {…} placeholder with your own value.

Response

The call returns the standard response envelope. Check ResponseState first: a failed call still returns HTTP 200.

ResponseStatestring
Required

Success, Invalid or Error.

ErrorCodeinteger

0 on success, otherwise the error code. See Errors.

ReturnUser[]

Response<User>: Return holds one User - the context user after authentication. ResponseState Success; only the 'Duration of call' message. Success with an empty Return only if no current user can be resolved after a successful authentication - not expected.

Example response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetUserResponse xmlns="http://www.timelog.com/api/tlp/v1_2">
      <GetUserResult xmlns:a="http://www.timelog.com/api/tlp/v1_1"
                     xmlns:b="http://www.timelog.com/api/tlp/v1_2"
                     xmlns:c="http://schemas.datacontract.org/2004/07/TimeLog.TLP.Security"
                     xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:Return>
          <b:User>
            <b:ID>1001</b:ID>
            <b:Initials>ABC</b:Initials>
            <b:FirstName>Example first</b:FirstName>
            <b:LastName>Example last</b:LastName>
            <b:LanguageID>1001</b:LanguageID>
            <b:Roles>
              <c:RoleTypes>ExternalContractor</c:RoleTypes>
            </b:Roles>
          </b:User>
        </a:Return>
        <a:ReturnTypeDescription>User</a:ReturnTypeDescription>
        <a:Request>…</a:Request>
        <a:ResponseState>Success</a:ResponseState>
        <a:Messages>
          <a:APIMessage>
            <a:Message>Duration of call was 0,0421337 sec.</a:Message>
            <a:Severity>Message</a:Severity>
            <a:ErrorCode>0</a:ErrorCode>
          </a:APIMessage>
        </a:Messages>
        <a:ErrorCode>0</a:ErrorCode>
      </GetUserResult>
    </GetUserResponse>
  </s:Body>
</s:Envelope>
Illustrative example: built from the service description (WSDL) in the same format as a real response, with made-up values. The Request block is shortened.

Errors

All errors come back with HTTP 200: check ResponseState, ErrorCode and Messages. The errors every operation can return (expired or invalid token, API not enabled, HTTPS required, general errors) are listed once in Responses and errors.

This operation has no errors of its own beyond the shared ones.