office 365 apis for your applications

71
Office 365 APIs for your Applications Ruhani Arora, Technology Evangelist, Microsoft @infinitydlimit

Upload: ruhani-arora

Post on 27-Jan-2017

66 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Office 365 APIs for your Applications

Office 365 APIs for your Applications

Ruhani Arora, Technology Evangelist, Microsoft@infinitydlimit

Page 2: Office 365 APIs for your Applications

Build intelligent apps by connecting to Office services

Make your solution part of Office apps

Engage users through conversations

Developer opportunityPlatform opportunities available today

Page 3: Office 365 APIs for your Applications

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>

Page 4: Office 365 APIs for your Applications

http://dev.office.com/

Make your solution a native part of Office on every platform

1

Page 5: Office 365 APIs for your Applications

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

Page 6: Office 365 APIs for your Applications

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

Page 7: Office 365 APIs for your Applications

http://dev.office.com/

Contextual mail add-in

2 Office add-in samples

Page 8: Office 365 APIs for your Applications

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

Page 9: Office 365 APIs for your Applications

http://dev.office.com/

Task pane add-in

2 Office add-in samples

Page 10: Office 365 APIs for your Applications

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

Page 11: Office 365 APIs for your Applications

http://dev.office.com/

Content add-in

2 Office add-in samples

Page 12: Office 365 APIs for your Applications

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

Page 13: Office 365 APIs for your Applications

http://dev.office.com/

Add-in command

2 Office add-in samples

Page 14: Office 365 APIs for your Applications

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

Page 15: Office 365 APIs for your Applications

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

Page 16: Office 365 APIs for your Applications

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

Page 17: Office 365 APIs for your Applications

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

Page 18: Office 365 APIs for your Applications

Demo

Page 19: Office 365 APIs for your Applications

http://dev.office.com/

Build smarter apps by connecting to Office services2

Page 20: Office 365 APIs for your Applications

http://dev.office.com/

Office 365 connected apps

Page 21: Office 365 APIs for your Applications

Building integration with Office 365

Page 22: Office 365 APIs for your Applications

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

Page 23: Office 365 APIs for your Applications

Many different APIs to access dataTwo separate auth stacks

State of the world before Microsoft Graph:

Work and school Personal

Page 24: Office 365 APIs for your Applications

World today with Microsoft Graph:

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

Work and school

Personal

&

Page 25: Office 365 APIs for your Applications

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/

Page 26: Office 365 APIs for your Applications

Demo Delve

Page 27: Office 365 APIs for your Applications

userPhoto

/me

departmentmobileaboutMebirthdaytagshireDatethumbnailPhotoaddressjobTitlenamealiaspastProjectsresponsibilitiesschoolsskills

USER

Page 28: Office 365 APIs for your Applications

CodeGET https://graph.microsoft.com/v1.0/users/[email protected]

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/[email protected]?$select=aboutMe

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

Page 29: Office 365 APIs for your Applications

manager

directReports

GROUPS

memberOf

USER

/users

Page 30: Office 365 APIs for your Applications

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

GET https://graph.microsoft.com/v1.0/contoso.com/users/[email protected]/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

Page 31: Office 365 APIs for your Applications

manager

directReports

GROUPS

memberOf

/messages

MESSAGES

USER

Page 32: Office 365 APIs for your Applications

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:[email protected]"

Page 33: Office 365 APIs for your Applications

MESSAGES

manager

directReports

GROUPS

memberOf

/events

MESSAGES

EVENTSUSER

Page 34: Office 365 APIs for your Applications

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

Page 35: Office 365 APIs for your Applications

EVENTS

MESSAGES

manager

directReports

GROUPS

memberOf

/drive

EVENTS

Shared with me

modifiedByFILE

S

createdBy

directReports

USERpubli

c

Page 36: Office 365 APIs for your Applications

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/[email protected]/drive/root/children

GET https://graph.microsoft.com/v1.0/[email protected]/drive/items/<id>/lastModifiedByUser/manager

Page 37: Office 365 APIs for your Applications

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

Page 38: Office 365 APIs for your Applications

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

Page 39: Office 365 APIs for your Applications

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

Page 40: Office 365 APIs for your Applications

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

GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/workingWith

GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/workingWith

Page 41: Office 365 APIs for your Applications

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

Page 42: Office 365 APIs for your Applications

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

GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/trendingAround

GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/trendingAround

Page 43: Office 365 APIs for your Applications

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

Page 44: Office 365 APIs for your Applications

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

GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/tasks

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

Page 45: Office 365 APIs for your Applications

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

Page 46: Office 365 APIs for your Applications

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/[email protected]/notes/sections

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

Page 47: Office 365 APIs for your Applications

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

Page 48: Office 365 APIs for your Applications

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/

Page 49: Office 365 APIs for your Applications

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/

Page 50: Office 365 APIs for your Applications

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

Page 51: Office 365 APIs for your Applications

• 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

Page 52: Office 365 APIs for your Applications

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

Page 53: Office 365 APIs for your Applications

• 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

Page 54: Office 365 APIs for your Applications

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

Page 55: Office 365 APIs for your Applications

Demo Graph Explorer

Page 56: Office 365 APIs for your Applications

http://dev.office.com/

Native mobile apps3

Page 57: Office 365 APIs for your Applications

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

Page 58: Office 365 APIs for your Applications

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

Page 59: Office 365 APIs for your Applications

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

Page 60: Office 365 APIs for your Applications

Demo

Page 61: Office 365 APIs for your Applications

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.

Page 62: Office 365 APIs for your Applications

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/[email protected]/people

Page 63: Office 365 APIs for your Applications

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

Page 64: Office 365 APIs for your Applications

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

Page 65: Office 365 APIs for your Applications

Code

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

"emailAddress": {"address": “[email protected]"},"type": "Required"}, {"emailAddress": {"address": “[email protected]"},"type": "Required"

}],"meetingDuration": "PT1H"}

Page 66: Office 365 APIs for your Applications

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

Page 67: Office 365 APIs for your Applications

http://dev.office.com/

Webhooks (now GA)

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

RoadmapOneDrive filesUsers and GroupsPlanner Tasks

Page 68: Office 365 APIs for your Applications

https://graph.microsoft.com/

Page 69: Office 365 APIs for your Applications

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

Page 70: Office 365 APIs for your Applications

• 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

Page 71: Office 365 APIs for your Applications

Twitter : @infinitydlimit