0

We have a list of ChromeOS Devices assigned to a group of people. Every user needs to login onto their ChromeOS machine with their Google account. I can find all devices where a given user has been signed on, but I cannot find the exact time they logged in onto that machine.

The only information available to me is the date when they logged in and how much time they had an active session on it.

Here's an example of what data I get from Google API.

{
"activeTimeRanges": [
  {
    "activeTime": 960021,
    "date": "2017-09-20"
  },
  {
    "activeTime": 1440016,
    "date": "2017-09-21"
  },
  {
    "activeTime": 1200032,
    "date": "2017-10-03"
  }
],
"deviceId": "xxxcccvvvbbb-xxxcccvvvbbb",
"kind": "admin#directory#chromeosdevice",
"lastEnrollmentTime": "2017-09-14T09:46:55.407Z",
"lastSync": "2017-10-03T13:12:42.121Z",
"recentUsers": [
  {
    "email": "xxxcccvvvbbb@xxxcccvvvbbb.com",
    "type": "USER_TYPE_MANAGED"
  }
],
"serialNumber": "xxxcccvvvbbbxxxcccvvvbbb",
"status": "ACTIVE"
}

So I can clearly see the user and the details I need to lock their device, but how can I be sure they were logged in onto this machine at a given time? I can only see they were active for 20 mins that day.

I am not sure however, if the lastSync can be used as the timestamp of when they logged in.

I have seen how to search for dates as well, such as: sync:2013-10-12, but I don't know what operator to use for finding the active session times.

https://support.google.com/chrome/a/answer/1698333

I have read Google's documentation, but haven't found anything pointing me towards the login times. I thought maybe I could find someone here that encountered this problem as well. Or maybe someone from Google that has worked on this API.

Eduard Ghinea
  • 87
  • 1
  • 8
  • 1
    "date" property is a `DateTime`, according to API reference. You receive it in date-only form, it looks like, but there could be date-time option as well. What URI you're using? – M. Prokhorov Oct 26 '17 at 10:54
  • I don't have any particular settings for date. I'll have a look into that. Thanks. Is this the URI are you asking for? GET https://www.googleapis.com/admin/directory/v1/customer/my_customer/devices/chromeos?orderBy=lastSync&orgUnitPath=%2FAll+Devices&fields=chromeosdevices(activeTimeRanges%2CdeviceId%2ClastSync%2CrecentUsers%2CserialNumber%2Cstatus)&key={YOUR_API_KEY} – Eduard Ghinea Oct 26 '17 at 10:58
  • 1
    I don't see any options regarding dates either. However, I do see an option to query within specific datetime, which does include time option. So maybe this can be an option for you. – M. Prokhorov Oct 26 '17 at 11:08
  • I have seen that as well, but apparently that date and time request can be used with a specific operator. For example: sync:2013-10-12. It's a pity there is no list of operators. I will need to guess the recent user one. – Eduard Ghinea Oct 26 '17 at 11:15

0 Answers0