How to retrieve a historical list of user logins:
[GET] /user-login-logs?include=user
If you need to identify specific employee roles, there's no direct way to link login events to user-roles via the API yet. We have a separate endpoint for user-roles where you can get a join list between employee.id and role.id, and filter for Administrator only employees with a request like:
[GET] /user-roles?include=role&role.name=Administrator
Given these, I'd imagine you'd need a two step approach:
- Build a list of latest Administrator employee IDs with /user-roles?include=role&role.name=Administrator
- Then foreach() on these employees to look if they've logged in since yesterday (note my $variables to substitute in):
/user-login-logs?include=user&loggedInOn:after=$yesterdayDate&user.id=$array[n]
Note: when you see user.id = 1000 in results, that's the TrackTik support account, which is Administrator by default. You can ignore this one since it's not web portal operational data.
Method
In responses is a field named "method". These are their possibilities:
Method String |
Description |
---|---|
API(device) |
Guard Tour application |
API |
TrackTik API regular auth |
API(ssoTk) |
TrackTik API - SSO auth |
web |
Web (portal) |
OpenID |
TrackTik API (OpenID auth) |
API(impTk) |
TrackTik API (Impersonate token, this can also be portal user impersonation I think) |
API(otpTk) |
TrackTik API (One time password token) |
API(rfTk) |
TrackTik API (refresh token) |