Search code examples
google-apigoogle-admin-sdk

Can I query users by using lastLoginTime in query in Google Admin sdk?


In my organization , we want to filter users who has not logged in for last 30 days.

Can I use query=lastLoginTime<2022-03-15 in google admin sdk api.

I am using this api https://admin.googleapis.com/admin/directory/v1/users?query=lastLoginTime<2022-03-15

Or is there any other api which return the expected result.

Thanks,


Solution

  • I am afraid it is not possible at the moment. This is the list of query parameters you can use with that method so far:

    • name
    • email
    • givenName
    • familyName
    • isAdmin
    • isDelegatedAdmin
    • isSuspended
    • im
    • externalId
    • manager
    • managerId
    • directManager
    • directManagerId
    • address
    • addressPoBox
    • addressExtended
    • addressStreet
    • addressLocality
    • addressRegion
    • addressPostalCode
    • addressCountry
    • orgName
    • orgTitle
    • orgDepartment
    • orgDescription
    • orgCostCenter
    • phone
    • orgUnitPath
    • isEnrolledIn2Sv
    • isEnforcedIn2Sv
    • schemaName.fieldName

    You can find additional info of each parameter in the official documentation here.

    In addition to that you can request this as a feature for this API here.