28
Introducing the Unified Communications Web API

Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Embed Size (px)

DESCRIPTION

Agenda

Citation preview

Page 1: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Introducing the Unified Communications Web API

Page 2: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Session Objectives

• Introducing the Unified Communications Web API (UCWA)

• UCWA Architecture• Working with Web APIs• Presence• Instant Messaging

Page 3: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Agenda

Instant MessagingPresence

ArchitectureOverview

Getting Started with the Unified Communications Web API

Page 4: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Overview

Page 5: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Overview

• One API across platforms, devices, and browsers• Embrace HTTP as application layer• Built on top of UCMA• REST-like API

• Presence• Group Memberships• Contacts• Privacy Relationships• Scheduled Conferences• Search• Instant Messaging

Page 6: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Development ExperiencePattern

Authenticate a user against UCWAOperations happen using the user’s identityInteract with the UCWA service endpointMake HTTP requests and handle responseFollow links in response if applicable

EnvironmentBrowser and language independentNo browser plugin requiredNo ActiveX dependencyLync client does not need to be running

Page 7: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Instant MessagingPresence

ArchitectureOverview

Getting Started with the Unified Communications Web API

Agenda

Page 8: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Architecture

Page 9: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Building Blocks

Lync Server Infrastructure

SIP Layer Media Stack Microsoft.Speech

UCMA 4.0 Core API UCMA Server Speech API

VoiceXMLUnified Communications Web API

Page 10: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

UCWA Represents an API View of Lync

Natively expose a Lync Server programming interface over HTTP

Abstract away dealing with the SIP protocol

Consistent programming interface for web and mobile clients

Page 11: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Authenticating UCWA Requests

Autodiscover• Attempt to locate Autodiscover service• Requested is redirected to OAuth endpoint

to get a token

OAuth Token• Provide user credentials• Token is attached to every request header• Token establishes the user’s identity

Page 12: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Web Token

Page 13: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Representational State Transfer (REST)

• Architectural pattern that sees the internet as a collection of resources available at unique locations (URLs\HREFs)

• Resources are nouns/things• /ucwa/applications(<applicationid>)/me is the

URL of the Me resource• Make HTTP requests to perform create, read,

update, and delete (CRUD) operations on resources• GET

/ucwa/applications(<applicationid>)/me/presence

• UCWA is REST-like

Page 14: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

REST - Hypermedia

• A response may contain links that can denote:• Resource – links between things• Capability – links that convey an action

• Application should check for links in the response• Only make a request to the link if it is available• Don’t hardcode URLs in request

Page 15: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Instant MessagingPresence

ArchitectureOverview

Getting Started with the Unified Communications Web API

Agenda

Page 16: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Presence

Page 17: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Getting a User’s PresenceRequest

GET Me resourceGET Presence resource

ResponseProperties

AvailabilityLinks

Note resourcePresence resourcePhoto resource

Page 18: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Event Channel

• Keep a channel open to handle real-time events• Changes in presence• Receive an instant message

• Presence• No need to poll for changes in presence• Listen for events on the event channel• Notification can contain information about multiple

events• If you receive a presence event, handle accordingly• After notification, make a call to listen to the next

event

Page 19: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

demoGetting User Presence in UCWA

Page 20: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Instant MessagingPresence

ArchitectureOverview

Getting Started with the Unified Communications Web API

Agenda

Page 21: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Instant Messaging

Page 22: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Implementing Instant Messaging using UCWA

• Create a “channel” for the new instant message

conversation

• Send an invitation for an instant message

conversation

• Get handle to the new instant message conversation

• Watch for new instant messages in the conversation

• Handle subsequent messages

Page 23: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

UCWA Instant Messaging Implementation

• Create application• POST on makeMeAvailable• POST on startMessaging• POST on sendMessage link under Messaging

resource• Listen for incoming messages on the event channel• Send more messages by doing a POST on

sendMessage link under Messaging resource

Page 24: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

demoImplementing Instant Messaging using UCWA

Page 25: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Instant MessagingPresence

ArchitectureOverview

Getting Started with the Unified Communications Web API

Agenda

Page 26: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

Key takeaways

• UCWA is a new REST-like API to enable real-time communications over the web

• Embrace HTTP as an application layer• Resource-oriented programming model• Simple data structures• UCWA removes browser, plugin, and programming language

dependencies

Page 27: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

thank you

Page 28: Agenda Pattern Authenticate a user against UCWA Operations happen using the user’s identity Interact with the UCWA service endpoint Make HTTP requests

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.