Getting last login information via API call

srinisubra
edited 12/09/19 in API & Developers

I am hitting the users endpoint(https://api.smartsheet.com/2.0/users) to get all of our user information. I am trying to find out inactive users based on last login date. The API call doesn't return me the last login information for any user. I can see this information when I export the csv of the users from the admin console though. The sample response from the list API shows the last login information. Any thoughts on why I am not getting this info through an API call?

 

https://smartsheet-platform.github.io/api-docs/#list-users

Comments

  • dAVE Inden
    dAVE Inden Employee

    For that request to have info on the last login for the users you'll need to make sure you are sending the request with a token from an account that is a System Admin. With that you can then use the include query string parameter set to a value of lastLogin. The example in the docs is using this query string. This will return a max of 100 user objects and you can use paging query string parameters to move through the pages of the results if needed.

    The URL would look like this:

    https://api.smartsheet.com/2.0/users?include=lastLogin