New SharePoint Framework PnP Samples available: using the Skype UCWA Web SDK to subscribe to people’s status

Jan 8, 2018

TL;DR;

I added two new SharePoint framework WebParts PnP sample to demonstrate how to use the Unified Communications Web API JavaScript SDK from Skype for business. This SDK allows you to do things like subscribe to a person status, start instant messaging conversations, calls…

16.gif

To get a look:

Long version

I recently had the occasion to make my first contribution to PnP (besides creating issues and helping investigate those). In these two new samples I show you how to you how to leverage the Skype UCWA SDK to subscribe and display people skype status.

That skype status will update itself it changes (ie: the target user sets his/her status to something different in Skype for business or goes offline).

This approach is better than the previous ones leveraging office integration, activeX or the SharePoint File User Status because:

  • It is cross platform (doesn’t need activeX, Internet Explorer, or security zones configuration)
  • It does not require Office to be installed on the machine or the user to be singed in Skype for Business
  • It updates with status changes
  • It does not need a file to be created and can be rendered anywhere on the page
    • (the file presence indicator is SharePoint talking to the Skype server and rendering some HTML, but it only does so in libraries)

The UCWA

The API itself is a bit peculiar a doesn’t necessary works like a “standard API” (OAuth + REST). The key differences being:

  • You can subscribe to some of the object model (status, conversations, audio/video feeds…)
  • Authentication is a bit (too) complex
    • It’s not standard and expects you to get a 403 in order to get the identity provider information
    • The discovery server also acts like a relay and the “API” is segmented in multiple resources (besides the permissions) which necessitates multiple rounds of authorization.
  • Not OData capable (we got used to that in the Microsoft world)

All those differences impart the few SDK’s. The JS SDK (the one used in the samples) is a bit “old fashioned”. I really wish they spent some time:

  • Moving to UMD and not a global var
  • Providing npm packages and not a single bundle on the CDN
  • Providing types definitions
  • Providing better version information (+ semver)
  • Allowing developer to leverage their own auth libraries (like hellojs or msal) instead of the implementation the have bundled.

Those are the main reasons why I’m side loading the script and not including it as an external dependency in the samples.

Lastly, the documentation is a little bit all over the place, I’d suggest you corroborate the information even from official sources because it looks like some of the documentation hasn’t been updated. Here are the entry points:

Microsoft Teams vs Skype

The skype for business API’s are still not available through the Microsoft Graph. And Microsoftannounced that Microsoft Teams is going to be the future for unified communications, instant messaging and so much more. However, Skype for business Server is going to keep being the backend (and at least provide some of the APIs) for a least a few years.


Last edited Apr 15, 2024 by Vincent Biret


Tags: