Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Microsoft Teams have a way to update a user's status/presence?

Recent news says that Skype For Business is eventually going to be taken down and replaced by Microsoft Teams.

I have a few projects that rely on Skype For Business and I use the following code to update a user's presence on Skype For Business using the 2013 lync SDK.

public static void PublishPresence(ContactAvailability contactAvailability)
{
    var publishData = new Dictionary<PublishableContactInformationType, object>
    {
        {PublishableContactInformationType.Availability, contactAvailability}
    };

        SendPublishRequest(publishData);
}

private static void SendPublishRequest(Dictionary<PublishableContactInformationType, object> publishData)
{
    try
    {
        PublishContactInformation(publishData);
    }
    catch (Exception exception)
    {
        _logger.Error("Cannot publish presence to Lync. Error: " + exception);
    }
}

public static void PublishContactInformation(Dictionary<PublishableContactInformationType, object> publishData)
{
    LyncClient lyncClient = LyncClient.GetClient();

    lyncClient.Self.BeginPublishContactInformation(publishData, ar => lyncClient.Self.EndPublishContactInformation(ar), null);
}

With that said we do plan on moving our projects to Microsoft Teams. However, we looked at the current Microsoft Teams SDK and we could not find any information about updating a user's presence.

Is something similar not listed on their documentation that allows myself to change my own status/presence?

like image 766
Rafael Avatar asked Oct 06 '17 14:10

Rafael


2 Answers

I'm happy to help with the API's that exist in Production or Preview today but Stack Overflow isn't the right platform for long-term roadmap discussions. That is something best left to official channels to disclose when it's ready.

At the moment, you're correct in that the Microsoft Teams SDK doesn't include APIs for interacting with Presence. This is because Teams itself is mirroring Skype's presence using Skype's API. You can replicate this functionality within your application using the similar APIs.

A good place to start would be the Unified Communications Web API (UCWA). If you're simply looking to surface Presence (rather than manipulate it), you can retrieve contactPresence. For manipulating the current user's status, you can use presence.

like image 110
Marc LaFleur Avatar answered Sep 19 '22 04:09

Marc LaFleur


To add some color to @MarcLaFleur-MSFT's answer...

All the calling/video/meeting functionality in Teams use Office-365 compliant instances of the Skype Consumer technology. It is a REST api, as @jeroen-mostert noticed, but it's not meant to be used by external developers. Besides the fact that it's not documented or supported, these endpoints require a special kind of access token.

The roadmap for Teams APIs definitely includes presence. But the API will be part of the Microsoft Graph API, not what you observe using Fiddler or the browser debugger today.

like image 43
Bill Bliss - MSFT Avatar answered Sep 18 '22 04:09

Bill Bliss - MSFT