onedrive mailbox.makeewsrequest( ); message forwarded by exchangeendpoint retrieves attachments app...

50

Upload: agnes-watts

Post on 28-Dec-2015

238 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook
Page 2: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Deep dive into Compose and other updates for Mail AppsAndrew SalamatovSenior Program ManagerMicrosoft

SPC391

Page 3: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Mail Apps – a brief intro

Page 4: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Type of apps in Apps for Office platform

Enable developers to extend Outlook using web technologies

Can be installed by end-users or admins for entire org

OneDrive

Page 5: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Mail AppsWrite once, run everywhereOutlook, Outlook Web App, OWA app for iPad and iPhoneMessages and appointments

Appear contextually, based on entities or patterns

Page 6: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

What’s new

Page 7: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

What’s new

Body and attachment accessEnd-users can install apps from the store that access message body and attachments

CommerceSell, give away or provide subscriptions for your mail apps

ComposeCreate apps to be used while reading a message or appointment, composing, or both

Page 8: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Body and attachment access

Page 9: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook
Page 10: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Attachments Demo(Harmon.ie)

Andrew Salamatov

Page 11: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Accessing attachments in 2013 RTMApp forwards the message to an SMTP endpoint Endpoint parses the message and extracts the attachmentsApp requires highest permission level, admin-installable only

mailbox.makeEwsRequest(

<XML EWS REQUEST>

);

Message forwarded by Exchange Endpoint retrieves attachmentsApp in Outlook

Page 12: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

New approach goalsEnd-user apps can access body and attachments

Optimize for client bytes over the wire

Page 13: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

The designJS APIs to access metadata, token and EWS URLAvailable with ReadItem permission

Outlook

APP

Exchange

App Backend

App requests attachment metadata,

callback token and EWS URL via JS APIs

Page 14: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

The designApp code passes metadata + token to its backendCallback token is short-lived, item bound

Outlook

APP

Exchange

App Backend

App passes attachment id, token

and EWS URL to its backend

Page 15: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

The designApp backend uses EWS to retrieve attachmentEWS Managed API support coming soon

Outlook

APP

Exchange

App Backend

App backend calls EWS to get attachment

Page 16: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

A few notes on the callback tokenExtends concept that apps can read any property on the current item

Item and session boundSelf-signed by Exchange, bearer tokenBound to current item (EWS operations only allowed on item that the app was launched on)“Bound” to session – is valid for 5 minutes

Allowed EWS APIsGetAttachmentsGetItem

Page 17: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Attachments code demo

Andrew Salamatov

Page 18: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Saving attachment to SharePoint1. Register mail app as a web server app in

AAD

2. Users grant permission via OAuth flow

3. Backend will get access token to call into OneDrive

Page 19: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

OAuth flowApp opens new window to Azure AD to ask for consent

Outlook

APP

Launch OAuth

Azure ADGrant Consent

App Backend

SP

Page 20: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

OAuth flowAzure AD redirects to the redirect URL, providing access code as query URI parameter

Outlook

APP

Launch OAuth

Azure ADGrant Consent

App’s redirect html page

App Backend

SP

Page 21: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

OAuth flowApp extracts access code and passes it to its backend

Outlook

APP

Launch OAuth

App’s redirect html page

App Backend

SP

Page 22: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

OAuth flowApp backend exchanges access code for refresh token and access token from Azure AD and calls into SP

Outlook

APP

Launch OAuth

App Backend

SP

Azure AD1. Exchange for refresh

and access token

2. Call SP with access token

Page 23: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Code demo

Andrew Salamatov

Page 24: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ResourcesDocumentationAccessing attachments from a mail app: http://msdn.microsoft.com/en-us/library/office/dn148008.aspxCreating a WebAPI backend service for a mail app: http://blogs.msdn.com/b/officeapps/archive/2013/06/10/create-a-web-service-for-an-app-for-office-using-the-asp-net-web-api.aspxDirectory service: http://msdn.microsoft.com/en-us/library/dn605898(v=office.15).aspxIntegrating app with AAD: http://msdn.microsoft.com/en-us/library/windowsazure/dn151122.aspx

Related SessionsWebsite app registration and auth: SPC371 (5pm Today!)Discovery service: SPC 3999New APIs in SharePoint: SPC 3999

Code will be posted to this session in Yammer after the talk

Page 25: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Commerce

Page 26: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Paid Mail AppsDevelopers can sell mail apps in Office storeModel supports:• Trial mode• Subscription• Individual purchase

Entitlement is validated server-sideDocumentation: http://msdn.microsoft.com/en-us/library/office/jj163908.aspx

Page 27: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose

Page 28: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose demo

Andrew Salamatov

Page 29: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail appsActivation

Capabilities

Permissions

Page 30: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ActivationApps can appear in messages and/or appointmentsCompose apps are across Desktop, Tablet and Mobile

Page 31: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

User Identity TokenMake EWS requestsSettingsUser Profile

Page 32: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

Get/set/add recipients orattendees

Get/set the subject

Page 33: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

Add file or item attachments

Page 34: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

Prepend to the body

Overwrite current selection in body

Page 35: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

Get/set start or end timeGet/set locationGet/set/add attendees

Page 36: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose mail app capabilitiesUse core JS APIsRead/Write recipientsRead/Write subjectAdd attachmentsWrite to the bodyR/W appointment propertiesCustom item properties

Saved on the sent item

Can be used to mark a composed message (eg “Tracked” in CRM)

Page 37: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

PermissionsRestrictedApp can access data from limited entitiesRegular expressions are blockedJS API limits item data access

ReadItemApp can access data from all entitiesRegular expressions allowedRead JS APIs are allowedEWS calls are not allowed

ReadWriteItemAll JS APIs are allowed

ReadWriteMailboxLimited EWS methods are allowed

ReadWriteMailbox

End-userscan install

Admins can install

Page 38: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose code demo

Andrew Salamatov

Page 39: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Possibilities…

Page 40: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ScenariosAssist with writing a messageFrequently written snippetsMultiple signaturesInsert meeting location detailsHierarchical Address Book

Book Workspace

Address Book

Bob Costas

Jane Smith

John Doe

Page 41: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ScenariosTemplate messages and meetingsCreate a message based on a templateAttach an invoice

Page 42: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ScenariosKick-off workflowsDocument signingRequest approval for marketing campaignRecord email conversation for innovation management

Newsletter Approval

Select documents for approval:

Page 43: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

ResourcesDemo code will be posted to #SPC391 Yammer discussion directly after the session

Documentation available on MSDNhttp://msdn.microsoft.com/EN-US/library/office/fp161135(v=office.15).aspx

Related talksOffice power hour – what’s new in Apps for Office: SPC 351Creating cloud hosted LOB apps: SPC 361New ODATA APIs in Exchange (right after this talk): SPC 379

Page 44: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

MySPCSponsored by

connect. reimagine. transform.

Evaluate sessionson MySPC using yourlaptop or mobile device:myspc.sharepointconference.com

Page 45: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

Page 46: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

Compose app capabilitiesFor those who could not attend the talk, the next slides show sample JS to give a feel for the APIs

Page 47: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

APIsCore APIsR/W recipients (to, cc, bcc)R/W subjectWrite data at cursor in bodyPrepend to bodyAdd file or item attachmentsR/W start/end time and locationCustom Properties

var item = Office.context.mailbox.item;

item.to.setAsync(“[email protected]”);item.subject.setAsync(“Hello”);

Page 48: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

APIsCore APIsR/W recipients (to, cc, bcc)R/W subjectWrite data at cursor in bodyPrepend to bodyAdd file or item attachmentsR/W start/end time and locationCustom Properties

var item = Office.context.mailbox.item;

item.body.setSelectedData( “<b>Hello!</b>”, { coercionType : ‘HTML’ });

item.body.prependAsync(“Hello World!”);

Page 49: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

APIsCore APIsR/W recipients (to, cc, bcc)R/W subjectWrite data at cursor in bodyPrepend to bodyAdd file or item attachmentsR/W start/end time and locationCustom Properties

var item = Office.context.mailbox.item;

item.addFileAttachmentAsync( “http://myurl.com/attachment.jpg”);

item.addItemAttachmentAsync(“EWS item id”);

Page 50: OneDrive mailbox.makeEwsRequest( ); Message forwarded by ExchangeEndpoint retrieves attachments App in Outlook

APIsCore APIsR/W recipients (to, cc, bcc)R/W subjectWrite data at cursor in bodyPrepend to bodyAdd file or item attachmentsR/W start/end time and locationCustom Properties

var item = Office.context.mailbox.item;var now = new Date();

item.start.setAsync(now);item.location.setAsync(“My office”);