SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

26
April 9 th , 2015 SharePoint Saturday Houston Microsoft Graph - Deep Dive Sébastien Levert Office 365 Junkie & MVP

Transcript of SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Page 1: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

April 9th, 2015

SharePoint Saturday Houston

Microsoft Graph - Deep DiveSébastien LevertOffice 365 Junkie & MVP

Page 2: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Welcome to SharePoint Saturday HoustonThank you for being a part of the 7th Annual SharePoint Saturday for the greater Houston area!• Please turn off all electronic devices or set them to vibrate.• If you must take a phone call, please do so in the hall so as not to disturb others.• Special thanks to our Diamond Sponsor, HSPUG

Page 3: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Thanks to all our Sponsors!

Page 4: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Information• Speaker presentation slides should be available

from the SPSHOU website within a week or so

• The Houston SharePoint User Group will be having it’s next meeting Wednesday April 20th. Please join us at www.h-spug.org

Page 5: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Who’s Sébastien Levert !?

Montreal, Canada oceanik.comOffice Servers &

Services MVP

Web Developer @sebastienlevertsebastienlevert.co

m

Page 6: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Agenda• Introduction to the Microsoft Graph• Azure AD Applications as the core of the

Microsoft Graph• Playing with the Microsoft Graph

• /v1.0• /beta

• Resources

Page 7: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Introduction to the Microsoft Graph

Page 8: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Building integration with Office 365

Page 9: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

What is Microsoft Graph?Single endpoint for:1.Accessing data

/me, /users, /groups, /messages, /drive, ….

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

3.Accessing insights/insights/trending

4.Work/School and Personal

https://graph.microsoft.com/

Page 10: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Use Microsoft Graph to build smart apps Gateway to data and insights in Office365

Easy traversal of objects and rich relationships

Web Standards, Open Platform

Secure data access

OAuth2.0OpenID ConnectRESTJSON

Page 11: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Azure AD Applications

Page 12: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Single authentication flow for Office 365• 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

Page 13: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

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 14: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Authentication Options• Azure AD only

• Separate auth flow supports Azure AD accounts only

• Azure AD and Microsoft Accounts (Preview)• Converged auth flow supports Azure AD accounts and Microsoft

accounts (LiveID - hotmail.com, etc.)

Page 15: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Playing with the Graph/v1.0

Page 16: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

How to use the Graph?• OData-driven REST API

• Enables the keywords in your REST calls• Your calls needs to be athenticated through you

Azure AD Application

Page 17: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

/v1.0• https://graph.microsoft.com/v1.0/me• https://graph.microsoft.com/v1.0/me/events• https://graph.microsoft.com/v1.0/me/events?

$select=subject,body, location,organizer&$filter=subject eq 'Very important meeting‘

• https://graph.microsoft.com/v1.0/me/messages• https://graph.microsoft.com/v1.0/me/MailFolders/

Inbox/messages• https://graph.microsoft.com/v1.0/me/drive• https://graph.microsoft.com/v1.0/me/drive/root/

children

Page 18: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Methods• POST

https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail{ "Message": { "subject": "Mail sent from the Microsoft Graph", "body": { "contentType": "HTML", "content": "How cool is that?!" }, "toRecipients": [ { "emailAddress": { "name": "Sébastien Levert", "address": "[email protected]" } } ] }, "SaveToSentItems": true}

Page 19: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

WebHooks• Enabled on

• Mails• Calendar Items• Personal Contacts

• https://graph.microsoft.com/v1.0/subscriptions

Page 20: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Playing with the Graph/beta

Page 21: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

/beta• https://graph.microsoft.com/beta/me• https://graph.microsoft.com/beta/groups?

$filter=groupTypes/any(c:c+eq+'Unified')• https://graph.microsoft.com/beta/me/tasks• https://graph.microsoft.com/beta/me/trendingAround• https://graph.microsoft.com/beta/me/drive/items/

01CJXFBOUU4KTNRTR5MJB3VSKOGNAOVK23/workbook/worksheets('ToDoList')/tables(‘1’)/rows

Page 22: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Conclusion

Page 23: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Resources

Page 24: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

References• Documentation, samples and more

• https://dev.office.com• https://graph.microsoft.io

• Stack overflow• [MicrosoftGraph] and [Office365]

• Twitter• #MicrosoftGraph and #Office365Dev

Page 25: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

References• Graph Explorer

• https://graph.microsoft.io/en-us/graph-explorer• ASP.NET WebHooks with the Microsoft Graph

• https://github.com/OfficeDev/Microsoft-Graph-ASPNET-Webhooks• Excel REST API ToDo List

• https://github.com/OfficeDev/Microsoft-Graph-ASPNET-Excel-REST-ToDo

Page 26: SharePoint Saturday Houston 2016 - Microsoft Graph - Deep Dive

Please Leave Feedback During Q&A