Posted by BjarkePetersen
Digon

API, User management: user last access

Hello,

I have been looking through the "TeamViewer API Documentation", but cannot figure out how to determine users "Last accessed" as shown in the TeamViewer Management Console...

The /api/v1/users?full_list doesn't include this.

Any help on how to obtain this property would be greatly appreciated!TV.png

1 Accepted Solution

Accepted Solutions
Highlighted
Posted by BjarkePetersen
Digon
Solution

Re: API, User management: user last access

I guess the only way to get this information is via /api/v1/reports/connections

 Dim from_date As String = DateAdd(DateInterval.Month, -3, Now.ToUniversalTime).ToString("yyyy-MM-ddTHH:mm:ssZ")
        Dim to_date As String = Now.ToUniversalTime.ToString("yyyy-MM-ddTHH:mm:ssZ")

        Dim MyUrl As String = String.Format("{0}/api/v1/reports/connections?userid={1}&from_date={2}&to_date={3}", APIbaseUri, UserId, from_date, to_date)

Remember to order the array/list (of record) result by end_date or start_date.

If anyone has a better way of doing this (rather than getting all connections from the last 3 months), I would like to hear about iit... 

 

1 Reply
Highlighted
Posted by BjarkePetersen
Digon
Solution

Re: API, User management: user last access

I guess the only way to get this information is via /api/v1/reports/connections

 Dim from_date As String = DateAdd(DateInterval.Month, -3, Now.ToUniversalTime).ToString("yyyy-MM-ddTHH:mm:ssZ")
        Dim to_date As String = Now.ToUniversalTime.ToString("yyyy-MM-ddTHH:mm:ssZ")

        Dim MyUrl As String = String.Format("{0}/api/v1/reports/connections?userid={1}&from_date={2}&to_date={3}", APIbaseUri, UserId, from_date, to_date)

Remember to order the array/list (of record) result by end_date or start_date.

If anyone has a better way of doing this (rather than getting all connections from the last 3 months), I would like to hear about iit...