Office 365 APIs for your Applications

Post on 27-Jan-2017

61 views 4 download

Transcript of Office 365 APIs for your Applications

Office 365 APIs for your Applications

Ruhani Arora, Technology Evangelist, Microsoft@infinitydlimit

Build intelligent apps by connecting to Office services

Make your solution part of Office apps

Engage users through conversations

Developer opportunityPlatform opportunities available today

http://dev.office.com/

OpportunityOver 4

trillion emails sent with O365

100+ million downloads of mobile apps

850 million

meetings are created a month

2–3 hours/day

spent in Office apps1.2

billion+ users

470+ PB

of storage

<#><Section title goes here>

http://dev.office.com/

Make your solution a native part of Office on every platform

1

http://dev.office.com/

Office add-ins

Built with web standardsOffice.js provides interopHosted centrallyAlmost zero client footprintRuns where Office runsDiscoverable marketplace

Browser Controlor iFrame

With HTML5, JavaScript, CSS

<?xml version="1.0" encoding="UTF-8"?><OfficeApp xsi:type="MailApp"> <Version>1.0.0.0</Version> <ProviderName>Salesforce.com</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue=“Salesforce" /> <Capabilities> <Capability Name="Mailbox" /> </Capabilities> <DesktopSettings> <SourceLocation DefaultValue=“https://salesforce.com/office" /> <RequestedHeight>300</RequestedHeight> </DesktopSettings> <Permissions>ReadItem</Permissions> <Rule xsi:type="RuleCollection" Mode="Or"> <Rule xsi:type="ItemIs" ItemType="Message"/> <Rule xsi:type="ItemIs" ItemType="Appointment"/> </Rule></OfficeApp>

Web server

1 Extend with add-ins

http://dev.office.com/

Office add-insA new way to build extensions for Office

Content add-inAdd-in that runs within a document content with read/write accessExcel, PowerPoint, Access

Contextual mail add-inAdd-in launched contextually from a mail message or appointmentOutlook and Outlook Web Access (OWA)

Add-in commandCommand in the Office UI to launch add-in or perform UI-less operationOutlook and Outlook Web Access (OWA)

Task pane add-inAdd-in that runs beside a document/mail with read/write accessWord, Excel, PowerPoint, Project, Outlook

2 Office add-in samples

http://dev.office.com/

Contextual mail add-in

2 Office add-in samples

http://dev.office.com/

Office add-insA new way to build extensions for Office

Content add-inAdd-in that runs within a document content with read/write accessExcel, PowerPoint, Access

Contextual mail add-inAdd-in launched contextually from a mail message or appointmentOutlook and Outlook Web Access (OWA)

Add-in commandCommand in the Office UI to launch add-in or perform UI-less operationOutlook and Outlook Web Access (OWA)

Task pane add-inAdd-in that runs beside a document/mail with read/write accessWord, Excel, PowerPoint, Project, Outlook

2 Office add-in samples

http://dev.office.com/

Task pane add-in

2 Office add-in samples

http://dev.office.com/

Office add-insA new way to build extensions for Office

Content add-inAdd-in that runs within a document content with read/write accessExcel, PowerPoint, Access

Contextual mail add-inAdd-in launched contextually from a mail message or appointmentOutlook and Outlook Web Access (OWA)

Add-in commandCommand in the Office UI to launch add-in or perform UI-less operationOutlook and Outlook Web Access (OWA)

Task pane add-inAdd-in that runs beside a document/mail with read/write accessWord, Excel, PowerPoint, Project, Outlook

2 Office add-in samples

http://dev.office.com/

Content add-in

2 Office add-in samples

http://dev.office.com/

Office add-insA new way to build extensions for Office

Content add-inAdd-in that runs within a document content with read/write accessExcel, PowerPoint, Access

Contextual mail add-inAdd-in launched contextually from a mail message or appointmentOutlook and Outlook Web Access (OWA)

Add-in commandCommand in the Office UI to launch add-in or perform UI-less operationOutlook and Outlook Web Access (OWA)

Task pane add-inAdd-in that runs beside a document/mail with read/write accessWord, Excel, PowerPoint, Project, Outlook

2 Office add-in samples

http://dev.office.com/

Add-in command

2 Office add-in samples

http://dev.office.com/

• In-browser web editor for building client-side Office add-ins

• Uses Office Online and OneDrive for file storage

• Intellisense for JavaScript and HTML5

• Allows for sharing and exporting

• Doesn’t expose full add-in manifest

Development options Napa

3 Getting started

http://dev.office.com/

• First-class development experience with templates

and debugging• Exposes the full add-in

manifest and automated deployment commands

• Allows for web projects containing both client-side

and server-side assets

Development optionsVisual Studio

3 Getting started

http://dev.office.com/

• You can use anything that delivers for the web

• Microsoft offering Yeoman generator for skeleton add-in project

• Keep in mind that add-ins need SSL/HTTPS

Development optionsOther

3 Getting started

http://dev.office.com/

• Responsive, mobile-first, front-end framework for developers that delivers instant look and feel of Office

• Handles typography, color, icons, animations, responsive grid layouts, and localization

Office UI Fabric

3 Getting started

Demo

http://dev.office.com/

Build smarter apps by connecting to Office services2

http://dev.office.com/

Office 365 connected apps

Building integration with Office 365

http://dev.office.com/

Calendar

Microsoft Graph APIs

https://graph.microsoft.com

And more …

Mail

PeopleDocuments

Access data and intelligence from the Microsoft cloud

Enabling a consistent development platform

For both commercialand consumer

Excel

Notebooks

Office Graph

Groups

Build smarter apps by connecting to Office services

Users

Many different APIs to access dataTwo separate auth stacks

State of the world before Microsoft Graph:

Work and school Personal

World today with Microsoft Graph:

Microsoft Graph (https://graph.microsoft.com/)

Work and school

Personal

&

Single endpoint for:

1.Accessing data/me, /users, /groups, /messages, /drive, ….

2.Traversing data/drive/items/<id>/lastmodifiedByUser

3.Accessing insights/insights/trending

4.Work/School and Personal

What is Microsoft Graph?

https://graph.microsoft.com/

Demo Delve

userPhoto

/me

departmentmobileaboutMebirthdaytagshireDatethumbnailPhotoaddressjobTitlenamealiaspastProjectsresponsibilitiesschoolsskills

USER

CodeGET https://graph.microsoft.com/v1.0/users/yina@contoso.com

GET https://graph.microsoft.com/v1.0/me

GET https://graph.microsoft.com/v1.0/contoso.com/users/<id>

GET https://graph.microsoft.com/v1.0/contoso.com/users/yina@contoso.com?$select=aboutMe

GET https://graph.microsoft.com/v1.0/me/photo

manager

directReports

GROUPS

memberOf

USER

/users

CodeGET https://graph.microsoft.com/v1.0/me/manager

GET https://graph.microsoft.com/v1.0/contoso.com/users/yina@contoso.com/directReports

GET https://graph.microsoft.com/v1.0/me/memberOf

GET https://graph.microsoft.com/v1.0/users/<id>

GET https://graph.microsoft.com/v1.0/contoso.com/users/<id>/photo

manager

directReports

GROUPS

memberOf

/messages

MESSAGES

USER

CodeGET https://graph.microsoft.com/v1.0/me/messages

GET https://graph.microsoft.com/v1.0/me/messages?$top=5

GET https://graph.microsoft.com/v1.0/me/messages?$top=5&$skip=5&$orderby=DateTimeCreated

GET https://graph.microsoft.com/v1.0/me/messages?$top=5&$select=Subject,Sender&$search="from:alexd@contoso.com"

MESSAGES

manager

directReports

GROUPS

memberOf

/events

MESSAGES

EVENTSUSER

CodeGET https://graph.microsoft.com/v1.0/me/events

GET https://graph.microsoft.com/v1.0/me/events?$top=5

GET https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2015-04-01t01:00:00z&enddatetime=2015-04-16t23:00:00z

EVENTS

MESSAGES

manager

directReports

GROUPS

memberOf

/drive

EVENTS

Shared with me

modifiedByFILE

S

createdBy

directReports

USERpubli

c

CodeGET https://graph.microsoft.com/v1.0/me/drive/root/children

GET https://graph.microsoft.com/v1.0/me/drive/items/<id>

GET https://graph.microsoft.com/v1.0/me/drive/items/<id>/lastModifiedByUser

GET https://graph.microsoft.com/v1.0/mary@contoso.com/drive/root/children

GET https://graph.microsoft.com/v1.0/mary@contoso.com/drive/items/<id>/lastModifiedByUser/manager

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

EVENTS

MESSAGES

manager

GROUPS

memberOf

/groups

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

USER

Code

GET https://graph.microsoft.com/v1.0/me/memberOf?$/microsoft.graph.group?$filter=groupTypes/any(a:a eq

'unified')

GET https://graph.microsoft.com/v1.0/contoso.com/groups/<id>/members

GET https://graph.microsoft.com/v1.0/contoso.com/groups/<id>/drive/root/children

GET https://graph.microsoft.com/v1.0/contoso.com/groups/<id>/conversations

GET https://graph.microsoft.com/v1.0/contoso.com/groups/<id>/events/<id>/accept

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

EVENTS

MESSAGES

manager

GROUPS

memberOf

/workingWith (preview)

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

workingWith

workingWithUSER

CodeGET https://graph.microsoft.com/beta/me/workingWith

GET https://graph.microsoft.com/beta/contoso.com/users/yina@contoso.com/workingWith

GET https://graph.microsoft.com/beta/contoso.com/users/mary@contoso.com/workingWith

workingWith

workingWith

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

EVENTS

MESSAGES

manager

GROUPS

memberOf

workingWith

workingWith

trendingAround

trendingAround

directReports

/trendingAround (preview)

USER

CodeGET https://graph.microsoft.com/beta/me/trendingAround

GET https://graph.microsoft.com/beta/contoso.com/users/yina@contoso.com/trendingAround

GET https://graph.microsoft.com/beta/contoso.com/users/mary@contoso.com/trendingAround

trendingAround

trendingAround

directReports

workingWith

workingWith

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

EVENTS

MESSAGES

manager

GROUPS

memberOf

/tasks (preview)

TASKS

TASKS

GROUPS

memberOf

trendingAround

trendingAround

directReports

USER

CodeGET https://graph.microsoft.com/beta/me/tasks

GET https://graph.microsoft.com/beta/contoso.com/users/yina@contoso.com/tasks

GET https://graph.microsoft.com/beta/contoso.com/groups/<id>/tasks

TASKS

TASKS

trendingAround

trendingAround

directReports

workingWith

workingWith

createdBy

FILES

CONVERSATIONS

EVENTS

GROUPS

memberOf

directReports

Shared with me

modifiedByFILE

S

createdBy

directReports

public

EVENTS

MESSAGES

manager

GROUPS

memberOf

/notes (preview)

NOTESNOTE

S

TASKS

TASKS

GROUPS

memberOf

USER

CodeGET https://graph.microsoft.com/beta/me/notes/notebooks

GET https://graph.microsoft.com/beta/me/notes/pages

GET https://graph.microsoft.com/beta/contoso.com/users/yina@contoso.com/notes/sections

GET https://graph.microsoft.com/beta/contoso.com/groups/<id>/notes/notebooks

TASKS

manager

memberOf

FILES

MESSAGES

workingWith

Shared with me

directReports

createdBy

FILES

CONVERSATIONS

createdBy

workingWith

EVENTS

trendingAround

GROUPS

TASKS

NOTESNOTE

S

public

modifiedBy

USERtrendingArou

nd

API

TASKS

manager

memberOf

FILES

MESSAGES

workingWith

Shared with me

directReports

createdBy

FILES

CONVERSATIONS

createdBy

workingWith

EVENTS

trendingAround

GROUPS

TASKS

NOTESNOTE

S

public

modifiedBy

USERtrendingArou

nd

API

https://graph.microsoft.com/

Data spread across multiple services

Operation Service endpointGET my profile https://graph.microsoft.com/v1.0/meGET my files https://graph.microsoft.com/v1.0/me/drive/root/childrenGET my photo https://graph.microsoft.com/v1.0/me/photo/$valueGET my mail https://graph.microsoft.com/v1.0/me/messagesGET my calendar https://graph.microsoft.com/v1.0/me/calendarGET my manager https://graph.microsoft.com/v1.0/me/managerGET last user to modify file foo.txt

https://graph.microsoft.com/v1.0/me/drive/root/children/foo.txt/lastModifiedByUser

GET users in my organization https://graph.microsoft.com/v1.0/usersGET group conversations https://graph.microsoft.com/v1.0/groups/<id>/conversationsGET people related to me https://graph.microsoft.com/beta/me/peopleGET my tasks https://graph.microsoft.com/beta/me/tasksGET my notes https://graph.microsoft.com/beta/me/notes/notebooksGET files trending around me https://graph.microsoft.com/beta/me/trendingAround

One endpoint to access it: https://graph.microsoft.com/

Many apps want to sign users in from both Microsoft account and Azure ADNow in preview:Single endpoint, OpenID Connect and OAuth 2.0Single SDKSingle end user sign in experienceSingle app registration experience

Works with Microsoft Graph Single API endpoint, business and consumer data

Authentication

• Sign users in using OpenID Connect Azure AD and Office 365 services Supports MFA and federated user sign-in

• Device apps, web sites, SPAs, and service apps

• Pin apps to Office 365 app launcher from My apps

Single authentication flow for Office 365

Common consent• Single auth flow for

accessing all O365 services

• Admin and end-user consent

• Secure protocol OpenID Connect and OAuth 2.0 No capturing user credentials Fine-grained access scopes Long-term access through refresh tokens

• Client: Active Directory Authentication Library (ADAL) .Net, Windows Store, Windows Phone JavaScript iOS Android Xamarin Cordova Node.js Java

• Server .Net: ASP.Net OWIN middleware for OpenID Connect and OAuth 2.0 Node.js

• More to come

Libraries: http://github.com/AzureAD

update

http://dev.office.com/

Announcing Microsoft Graph SDKs

SDKs for Graph v1.0 featuresEasily pluggable auth

ADAL libraries for auth V1.0Preview MSAL library for auth V2.0 (.Net)

Platforms: (GA) (RC)

OSS tools – easily customize from metadatahttps://github.com/microsoftgraph

Demo Graph Explorer

http://dev.office.com/

Native mobile apps3

http://dev.office.com/

Single authentication flowAcross all Office 365 services“Native” apps and web sitesAdmin and end-user consent

Secure protocolOAuth 2.0 (no capturing user credentials)Fine-grained access scopesSupports MFA and federated user sign-inLong-term access through refresh tokens

Unique considerationsof “Native” Azure AppsInherently multi-tenantNo client/app secret (think about distribution)Leverage a web authentication window/broker (via ADAL)No application-only permissions (can go through proxy service)

1 Intro

Azure AD OAuth in Office 365

http://dev.office.com/

Microsoft Graph Mobile SDKs

iOShttps://github.com/OfficeDev/Office-365-SDK-for-iOS

Androidhttps://github.com/OfficeDev/Office-365-SDK-for-Android

CordovaNo SDK needed—Make REST API calls via Jquery

Xamarin/Windows UniversalUse the .NET SDK

1 Intro

Open platform

ADAL Library ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔Office 365 SDK ✔ ✔ ✔ ✔ ✔ ✔ ✔Dev.office.com samples ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔ ✔

Azure AD and Office 365 offer Libraries/SDKs, but they are not mandatory as the platform is building on web standards such as OAuth2, REST, and Odata.

2 Connect with Microsoft Graph APIs

Demo

http://dev.office.com/

People API (preview)

Search and browse for the people who matter mostDynamically ranks people based on communication, collaboration, business relationship signals.Augment search queries with topics discussed in previous communicationsFuzzy matching for misspelled namesProvides a complete view of an individual, combining properties from multiple Office 365 services.

Discover who is relevant to your colleaguesOrganization charts don’t always convey working relationships.Learn who your colleagues interact with most closely.

Code

Host: https://graph.microsoft.com

GET /beta/me/people

GET /beta/me/people?$filter=sources/any(s:s/type eq 'Directory')

GET /beta/me/people?$search="Alek Darou"

GET /beta/me/people?$search="Al topic: merger"

GET /beta/users/yina@contoso.com/people

The OneDrive API gives you access to files from everywhere – personal, business, enterprise

Use the new OneDrive API or Microsoft Graph

OneDrive API Overview

Files

Lists

Team Sites

Document Libraries

OneDrive for

Business

OneDrive Consume

r

CSOM / SP REST API

USERS MAIL CALENDAR TASKSGROUPS

Microsoft Graph API - graph.microsoft.com

OneDrive APIdev.onedrive.com

http://dev.office.com/

Find Meeting Times API (preview)

Easily find meeting times

InputAttendees and Meeting DurationLocationConstraint, TimeConstraintMaxCandidates

Returns MeetingTimeCandidate with ‘Confidence’ and ‘Score’

Based on meeting booking history(*)Only for Office 365 work and school accounts

Code

Host: https://graph.microsoft.comPOST /beta/me/findMeetingTimeBody{"attendees": [{

"emailAddress": {"address": “yina@contoso.com"},"type": "Required"}, {"emailAddress": {"address": “gareth@contoso.com"},"type": "Required"

}],"meetingDuration": "PT1H"}

http://dev.office.com/

3. NOTIFY2. VALIDATE

Webhooks on the Microsoft Graph

Your App

/subscriptions

outlook.com

graph.microsoft.com

/notifications

1. CREATE

Outlook Apps

http://dev.office.com/

Webhooks (now GA)

Subscribe today to changes on Mail, Calendar,Personal contacts, Group conversations

RoadmapOneDrive filesUsers and GroupsPlanner Tasks

https://graph.microsoft.com/

Gateway to data and insights in Office365

Use Microsoft Graph to build smart apps Easy traversal of

objects and rich relationships

Web Standards, Open Platform

Secure data access

OAuth2.0OpenID ConnectRESTJSON

• Use Microsoft Graph with SDKs! • Visit http://aka.ms/graphsdks for SDKs

on each platform• Build add-ins today:

https://dev.office.com/getting-started/addins• Check out the generation tools at

https://github.com/Microsoft/VIPR • Continue your education at

Microsoft Virtual Academy online.

Related Content

Twitter : @infinitydlimit