Getting last login information via API call

Options

I have looked at the documentation for the API call but when I am hitting the users endpoint: https://api.smartsheet.com/2.0/users?include=lastLogin,source&includeAll=true it is not including the lastLogin information.

If I hit: https://api.smartsheet.com/2.0/users?include=lastLogin then I will receive it for those users that have logged in. Any thoughts on why I'm not getting this info through the first API call?

Also, I would like to pull in all fields that would normally be included in /users/<userid> using a single call, is this possible?

Answers

  • Julio S.
    Julio S. Moderator
    edited 07/20/22
    Options

    Hi @chuckleswk,

    When using both calls, I was able to obtain all query parameters including "lastLogin" for each ACTIVE user object who has logged in at least once. Both calls returned results in a single page.

    Therefore, there doesn't seem to be anything wrong with any of them if you are intending to return this information for all users without paginating results. Please include a capture of an example of the information returned when using these calls in your environment making sure to hide any sensitive information contained that you wouldn't want to share.

     Cheers!

    Julio

  • chuckleswk
    Options

    Thank you for your response.

    I am attaching 2 screen shots of the queries and the results. As you can see, if I'm paging then I receive all of the information, but if I'm wanting to receive it all back in a single query it does not provide me with the last login information.


  • Julio S.
    Julio S. Moderator
    edited 07/23/22
    Options

    Hi @chuckleswk,

    I can't seem to see anything being incorrect in your calls. If all headers are active and the relevant users have logged in at least once, and you haven't done yet, I would recommend opening a ticket with our Support team via this form. When doing so, I'd recommend sharing the whole information (including the user data) so that it can be confirmed that the users have indeed logged in at least once.

    Cheers!

    Julio