Building Productivity
Solutions with
Microsoft Graph
Microsoft Graph
solutions
Single API 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/
Many different APIs to access data
Separate auth stacks for work and personal
State of the world before Microsoft Graph
Work and school Personal
Today’s world with Microsoft Graph
Microsoft Graph
https://graph.microsoft.com
Work and school Personal
…
Diverse API styles and endpoints
https://graph.windows.net/contoso.com/users
https://graph.windows.net/contoso.com/groups
https://apis.live.net/v5.0/me
https://contoso.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties
https://graph.microsoft.com/v1.0/me/photo
https://outlook.office.com/api/v2.0/me/Messages
https://outlook.office.com/api/v2.0/me/Events
https://contoso-my.sharepoint.com/personal
/yina_contoso_com/_api/v2.0/drive
https://contoso.sharepoint.com/sites
/designCouncil/_api/v2./drive
https://api.onedrive.com/v1.0/drive
https://contoso.sharepoint.com/_api/search/query?Querytext='*'&Prop
erties='GraphQuery:actor(ME,action:1020,or(action:1020,action:1003
,action:1001,action:1024,action:1005,action:1037,action:1039,action
:1036)'&SelectProperties='Docid,Title
Unified API style – single endpoint
Operation Service endpoint
GET my profile https://graph.microsoft.com/v1.0/me
GET my files https://graph.microsoft.com/v1.0/me/drive/root/children
GET my photo https://graph.microsoft.com/v1.0/me/photo/$value
GET my mail https://graph.microsoft.com/v1.0/me/messages
GET my calendar https://graph.microsoft.com/v1.0/me/calendar
GET my manager https://graph.microsoft.com/v1.0/me/manager
GET 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/users
GET group conversations https://graph.microsoft.com/v1.0/groups/<id>/conversations
GET people related to me https://graph.microsoft.com/beta/me/people
GET my tasks https://graph.microsoft.com/beta/me/tasks
GET my notes https://graph.microsoft.com/beta/me/notes/notebooks
GET files trending around me https://graph.microsoft.com/beta/me/insights/trending
https://graph.microsoft.com
What’s in
Microsoft Graph today
Why Microsoft Graph?
Unified API Easy data
traversing
Online and
on-premises
Traversing data
in Microsoft Graph
What can you build with
Microsoft Graph?
What can you build with Microsoft Graph?
Web
applications
Native
applications
Worker
processes/
APIs
Office
web add-ins
SharePoint
Framework
web parts
Single Page
Application
s
Classic
SharePoint
web parts
Bots …and more
Authenticating for Microsoft Graph
Create AAD
app
Grant
permissions
Link
application
to AAD app
Authenticate
user
Get access
token
rencore.com
Authentication scenarios for Azure Active Directory
rencore.com
More authentication scenarios: http://wldk.nl/aad-auth-scenarios
Single Page Applications
Building solutions with
Microsoft Graph
…and SharePoint Framework 
Next steps
1. Experiment with Graph Explorer
https://graph.microsoft.io/en-us/graph-explorer
2. Learn the API
https://graph.microsoft.io/en-us/docs
3. Get inspired (PnP samples)
http://wldk.nl/msgraph-samples
4. Contribute
https://github.com/microsoftgraph
More on MS Graph:
https://blog.mastykarz.nl/tag/microsoft-graph/
https://blog.mastykarz.nl/tag/office-365-unified-api/
rencore.com
Download
SPTransformator now at
www.sptransformator.c
om
Waldek Mastykarz
waldek@rencore.com
blog.mastykarz.nl
@waldekm
Senior Developer at Rencore
Office Development MVP

Building productivity solutions with Microsoft Graph

  • 1.
  • 3.
  • 4.
    Single API for: 1.Accessingdata /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/
  • 5.
    Many different APIsto access data Separate auth stacks for work and personal State of the world before Microsoft Graph Work and school Personal
  • 6.
    Today’s world withMicrosoft Graph Microsoft Graph https://graph.microsoft.com Work and school Personal …
  • 7.
    Diverse API stylesand endpoints https://graph.windows.net/contoso.com/users https://graph.windows.net/contoso.com/groups https://apis.live.net/v5.0/me https://contoso.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties https://graph.microsoft.com/v1.0/me/photo https://outlook.office.com/api/v2.0/me/Messages https://outlook.office.com/api/v2.0/me/Events https://contoso-my.sharepoint.com/personal /yina_contoso_com/_api/v2.0/drive https://contoso.sharepoint.com/sites /designCouncil/_api/v2./drive https://api.onedrive.com/v1.0/drive https://contoso.sharepoint.com/_api/search/query?Querytext='*'&Prop erties='GraphQuery:actor(ME,action:1020,or(action:1020,action:1003 ,action:1001,action:1024,action:1005,action:1037,action:1039,action :1036)'&SelectProperties='Docid,Title
  • 8.
    Unified API style– single endpoint Operation Service endpoint GET my profile https://graph.microsoft.com/v1.0/me GET my files https://graph.microsoft.com/v1.0/me/drive/root/children GET my photo https://graph.microsoft.com/v1.0/me/photo/$value GET my mail https://graph.microsoft.com/v1.0/me/messages GET my calendar https://graph.microsoft.com/v1.0/me/calendar GET my manager https://graph.microsoft.com/v1.0/me/manager GET 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/users GET group conversations https://graph.microsoft.com/v1.0/groups/<id>/conversations GET people related to me https://graph.microsoft.com/beta/me/people GET my tasks https://graph.microsoft.com/beta/me/tasks GET my notes https://graph.microsoft.com/beta/me/notes/notebooks GET files trending around me https://graph.microsoft.com/beta/me/insights/trending https://graph.microsoft.com
  • 9.
  • 10.
    Why Microsoft Graph? UnifiedAPI Easy data traversing Online and on-premises
  • 11.
  • 12.
    What can youbuild with Microsoft Graph?
  • 13.
    What can youbuild with Microsoft Graph? Web applications Native applications Worker processes/ APIs Office web add-ins SharePoint Framework web parts Single Page Application s Classic SharePoint web parts Bots …and more
  • 14.
    Authenticating for MicrosoftGraph Create AAD app Grant permissions Link application to AAD app Authenticate user Get access token rencore.com
  • 15.
    Authentication scenarios forAzure Active Directory rencore.com More authentication scenarios: http://wldk.nl/aad-auth-scenarios Single Page Applications
  • 16.
    Building solutions with MicrosoftGraph …and SharePoint Framework 
  • 17.
    Next steps 1. Experimentwith Graph Explorer https://graph.microsoft.io/en-us/graph-explorer 2. Learn the API https://graph.microsoft.io/en-us/docs 3. Get inspired (PnP samples) http://wldk.nl/msgraph-samples 4. Contribute https://github.com/microsoftgraph More on MS Graph: https://blog.mastykarz.nl/tag/microsoft-graph/ https://blog.mastykarz.nl/tag/office-365-unified-api/ rencore.com
  • 18.
  • 19.

Editor's Notes

  • #10 https://graph.microsoft.io/en-us/docs
  • #11 Unified API The same authentication protocol across the different workloads The same API structure across the the different workloads REST with OData 4.0