Get MS Teams User's Status with last seen time

64 Views Asked by At

I want to have the presence of the MS Teams user along with the ability to access the last seen time

For Example, when I see a person in the team who is away for 15 minutes. I want to capture the Status as Away and Time that last 15 minutes.

I know I can get the status with Presence API but not sure How can I get that value of Last Seen 15 minutes away.

See the screenshot below for your reference.

enter image description here

1

There are 1 best solutions below

0
Hayden On

You can set up a subscription to get notified of changes to a user's presence. Here's the documentation page for subscription creation. This will avoid the need to constantly poll the API. Unfortunately, it looks like you will have to save and store the timestamp of when the change occurred to know how long they've been away.