UCWA - It's here and you should be too

After many months of hit/miss details on UCWA (Unified Communications Web-API) it is finally time to start creating with UCWA. With the Lync 2013 Conference in the recent past, there have been small glimpses of UCWA sprinkled throughout demos for the lucky attendees some during sessions and for the casual speculator during the Opening Keynote itself. I say speculation as you would need to corner a Lync Team member or two and get confirmation (good luck with this one...). In reality it is highly possibly that a good portion of Lync now or going forward will be UCWA-based. Its reach has the potential to be far greater than a platform-dedicated API such as UCMA (quick note: UCMA is not going away). Enough with the casual speculation, UCWA enables Lync capabilities on any device and with UCWA the designer/developers are free to present Lync in a paradigm-appropriate fashion.

UC-What-API?

No time to explain, read these: UCWA - Unified Communications Web-pal and What is Lync UCWA API

What can I do right now...

You should stop reading right this second and point your favorite web-browsing device to the Lync Web Developer Site and check out the Interactive Demo if you missed it at the conference or jump right into Code. A side-task could be bugging IT to upgrade to Lync Server 2013 CU1 (this is where UCWA arrived): Email. Read this MSDN Forum Topic for an additional step in UCWA deployment.

If you are interested in jumping right into code, make sure to download the UCWA Helper Libraries.

If you want a more advanced look at what is going on look at the network traffic in Fiddler or your favorite browser-based debugging tools while viewing the Interactive Demo. From a raw-HTTP standpoint those are the commands that is making all that UCWA magic. Before jumping the gun and hand-crafting URLs and web-requests it would be good to dive into the documentation specifically Hypermedia.

Using those OAuth Tokens

If you had a chance to step through the demo above you are mere web requests away from creating a UCWA application. The typical process of UCWA starts with AutoDiscovery, Authentication, Creating Application, and Log-in. With the OAuth Tokens technically we can skip to Creating Application, but without some important links it is impossible to create an application and in general it is bad practice to hard-code links as per the principles of Hypermedia. For a quick-start check out KeyTask - Create an Application and think of replacing contoso.com with gotuc.net for the initial Auto-discovery step:

Compare that with the response found on the key task page (highlighted below) shows the slight differences making it difficult to depend on hard-coded links:

Continuing on with key task by jumping to step 7, since 3 OAuth Tokens are already available, it is possible to attach one into an Authorization header as such:

Once you have reached the end of the key task you should have a response similar to:

communication, me, onlineMeeting, people are what can be considered the available Lync capabilities for this application. For more information on these and other resources look at the Dynamic API Graph.

Tools of the trade

With a new technology it is always best to gather a few tools to make learning that much easier.

  • Fiddler - For Windows this is an exceptional web traffic tool. The fun part about it is that it can display the requests being made as well as allow a mechanism for hand-crafting requests (when the need arises). I've also have planned a Fiddler Inspector specifically for UCWA development and hope to do a follow-up post containing the goodies and usage.
  • Web Debugging - The most modern browsers have developer tools built-in (F-12/Menus) or expanded via add-ons (FireBug) and they are pretty solid when it comes to needing to debug html/JS/Net traffic.

Check out Tracing and Debugging Tools for Browser-Based Applications for more details on debugging.

What's next

There is so much more UCWA concepts and ideas that I plan on elaborating in the coming days with the possibility of a sample application to demonstrate the key concepts of UCWA. In the interim read up on the documentation, play around with Fiddler, and wait patiently for the upcoming UCWA Developer Roundtable later this month or early next.