Introduction to the Microsoft Graph :
Getting Started Quickly & Getting the
Most Out of It
Vincent Biret
Microsoft
Microsoft Graph SDKs Software developer
Montréal
@baywet
Thank you
Sponsors!!!
#M365Ottawa @SPSOttawa
Introduction to the Microsoft Graph
Microsoft Graph Toolkit
Authentication & authorization
Tips
Conclusion
Agenda
Your gateway to Microsoft 365
Your
app
Gateway
Your data or
your
customer’s
Office 365 Windows 10 Enterprise Mobility and Security
1Microsoft Graph
Personal and organizational accounts
(lucy)
What data is available?
https://graph.microsoft.com
Users, Groups, Organizations
Outlook
SharePoint
OneDrive
Teams
Planner
Excel
OneNote
Activities
Devices relays
Commands
Notifications
Azure AD
Intune
Identity Manager
Advanced Threat Analytics
Advanced Threat Protection
Email, Calendar,
Contacts and Tasks
Sites and Lists
Disks and Files
Channels, Messages
Tasks and Plans
Worksheets
Notes, and more…
Identity management
Access control
Synchronization
Domains
Organizational units
Applications and Devices
Threats analysis
Threats protection
Alerts
Policies
And more…
Office 365 Windows 10 Enterprise mobility and security
Dynamics 365
Finances
Wide and transversal API
SITES
GROUPS
USERSINSIGHTS
CONTACTS
PEOPLE
ORGANIZATION
EMAIL
CONTENT
DOCUMENTS
DEVICES
TEAMS
REPORTS
ME
ADMIN UNITS
ROLES
APPS
SECURITY DATA &
AUTOMATION
ORGANIZATION
USERS
BUSINESS
PARTNER
Basics
• HTTP verbs represent the intent: GET | POST | PATCH | PUT | DELETE
• Version: /v1.0 or /beta
• Resource: /users, /groups, /sites, /drives, /devices, …
• Collection item: /users/john
• Property: /users/john/department
• Linked data via navigation: /users/john/events
• Query parameters: /users/john/events?$top=5
o Format: $select | $orderby
o Filter/Navigate: $filter | $expand
o Pagination: $top | $skip | $skiptoken
/{version} ?{parameters}/{resource}/{id}/{property}
SDKs
Generally Available ( /v1.0 ) Preview ( /beta )
Microsoft Graph Toolkit
Reusable web components bound to Microsoft 365 data
Work with PWA’s, SPFx, Teams Tabs and more
Why use Microsoft Graph Toolkit?
Fully functional
Cut development time,
simplify code, and build
features faster
Beautiful, but flexible
Built to look like an
M365 experience, but
fully customizable
Works everywhere
Based on web
standards and can be
used wherever you use
HTML.
The components
Login Person
Agenda
Person Card
People People Picker
Tasks
Teams Channel Picker
Get
Try them all on the playground at https://mgt.dev!
Basics
access_tokenMSAL
Your APP
Microsoft
Graph
id_token
access_token refresh_token
Microsoft
Identity
Context
Users can consent for their data, admins for the whole tenant Only admins can consent
Delegated
permissions
User’s
privileges
App
permissions
Permission Type: applicationPermission Type: Delegated
Access as a user Access as a service
Effective PermissionsEffective Permissions
Scopes structure
specific: .All,
.Shared, etc
Read,
ReadWrite,
etc.
Target Entity:
files, mail,
groups,
calendars,
etc…
Ex: User.Read Directory.ReadWrite.All
Resource Action Scope
Know your OData!
Sets
$count
$filter
$expand
$orderby
$select
$skip/$skipToken
$top
Search
$search
Values
$ref
$value
$whatif to the rescue
Simply add $whatif at the end of a request to know where the data is coming from
Useful when debugging
/me/?$whatif
{
"Description": "Execute HTTP request",
"Uri": "https://graph.windows.net/v2/c03a026e-335e-458c-bad2-3309fe59663b/users('c9452811-
4b6e-4073-b7cf-
3f681f55539b')?$select=businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,office
Location,preferredLanguage,surname,userPrincipalName,id",
"HttpMethod": "GET"
}
Additional concepts
Batching
Throttling
Change notifications
Change tracking
Schema/Open extensions
Conclusion
Consistent APIs
Think about Auth
Shorter delivery time
Better apps integration
Better user experience
THANK YOU
Feedback form
https://bit.ly/3dcSfSw
https://graph.microsoft.com

#MSGraph introduction at #M365SaturdayOttawa

  • 1.
    Introduction to theMicrosoft Graph : Getting Started Quickly & Getting the Most Out of It Vincent Biret Microsoft Microsoft Graph SDKs Software developer Montréal @baywet
  • 2.
  • 3.
    Introduction to theMicrosoft Graph Microsoft Graph Toolkit Authentication & authorization Tips Conclusion Agenda
  • 5.
    Your gateway toMicrosoft 365 Your app Gateway Your data or your customer’s Office 365 Windows 10 Enterprise Mobility and Security 1Microsoft Graph
  • 6.
  • 7.
    What data isavailable? https://graph.microsoft.com Users, Groups, Organizations Outlook SharePoint OneDrive Teams Planner Excel OneNote Activities Devices relays Commands Notifications Azure AD Intune Identity Manager Advanced Threat Analytics Advanced Threat Protection Email, Calendar, Contacts and Tasks Sites and Lists Disks and Files Channels, Messages Tasks and Plans Worksheets Notes, and more… Identity management Access control Synchronization Domains Organizational units Applications and Devices Threats analysis Threats protection Alerts Policies And more… Office 365 Windows 10 Enterprise mobility and security Dynamics 365 Finances
  • 8.
    Wide and transversalAPI SITES GROUPS USERSINSIGHTS CONTACTS PEOPLE ORGANIZATION EMAIL CONTENT DOCUMENTS DEVICES TEAMS REPORTS ME ADMIN UNITS ROLES APPS SECURITY DATA & AUTOMATION ORGANIZATION USERS BUSINESS PARTNER
  • 9.
    Basics • HTTP verbsrepresent the intent: GET | POST | PATCH | PUT | DELETE • Version: /v1.0 or /beta • Resource: /users, /groups, /sites, /drives, /devices, … • Collection item: /users/john • Property: /users/john/department • Linked data via navigation: /users/john/events • Query parameters: /users/john/events?$top=5 o Format: $select | $orderby o Filter/Navigate: $filter | $expand o Pagination: $top | $skip | $skiptoken /{version} ?{parameters}/{resource}/{id}/{property}
  • 10.
    SDKs Generally Available (/v1.0 ) Preview ( /beta )
  • 13.
    Microsoft Graph Toolkit Reusableweb components bound to Microsoft 365 data Work with PWA’s, SPFx, Teams Tabs and more
  • 14.
    Why use MicrosoftGraph Toolkit? Fully functional Cut development time, simplify code, and build features faster Beautiful, but flexible Built to look like an M365 experience, but fully customizable Works everywhere Based on web standards and can be used wherever you use HTML.
  • 15.
    The components Login Person Agenda PersonCard People People Picker Tasks Teams Channel Picker Get Try them all on the playground at https://mgt.dev!
  • 18.
  • 19.
    Context Users can consentfor their data, admins for the whole tenant Only admins can consent Delegated permissions User’s privileges App permissions Permission Type: applicationPermission Type: Delegated Access as a user Access as a service Effective PermissionsEffective Permissions
  • 20.
    Scopes structure specific: .All, .Shared,etc Read, ReadWrite, etc. Target Entity: files, mail, groups, calendars, etc… Ex: User.Read Directory.ReadWrite.All Resource Action Scope
  • 23.
  • 24.
    $whatif to therescue Simply add $whatif at the end of a request to know where the data is coming from Useful when debugging /me/?$whatif { "Description": "Execute HTTP request", "Uri": "https://graph.windows.net/v2/c03a026e-335e-458c-bad2-3309fe59663b/users('c9452811- 4b6e-4073-b7cf- 3f681f55539b')?$select=businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,office Location,preferredLanguage,surname,userPrincipalName,id", "HttpMethod": "GET" }
  • 25.
  • 29.
    Conclusion Consistent APIs Think aboutAuth Shorter delivery time Better apps integration Better user experience
  • 30.
  • 31.

Editor's Notes

  • #16 Show mgt.dev
  • #17 https://mgt.dev
  • #26 https://docs.microsoft.com/en-us/graph/json-batching https://docs.microsoft.com/en-us/graph/throttling https://docs.microsoft.com/en-us/graph/webhooks https://docs.microsoft.com/en-us/graph/delta-query-overview https://docs.microsoft.com/en-us/graph/extensibility-overview