building intelligent apps using microsoft graph
TRANSCRIPT
Building Intelligent Apps using Microsoft GraphRoy Sheinfeld, Co-founder and CTO, harmon.ie – ESPC 16’
The most strategic developer surface area for us is Office 365
“
”—Satya Nadella
2
Why use the Microsoft Graph?
Single API for accessing more than one workload – break the data silos
Ability to tap into consumer market (Work & Personal)
Ability to built Intelligent applications
3
Single API for accessing more than one workload
User Files ConversationsPeople & Groups
Events
MANAGER
CONVERSATIONS
EVENTS
FILES
MESSAGES
PEOPLE
USER FILESEMAIL AND
CONVERSATIONS PEOPLE
EVENTS
Data silos in the enterprise
GROUPS
5
Directory
Azure Active Directory Graph API https://graph.windows.net/contoso.com/usershttps://graph.windows.net/contoso.com/groups
USER PEOPLE
GROUPS
6
Extended Profile
SharePoint User Profilehttps://contoso.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetMyProperties Exchange HD Picturehttps://outlook.office365.com/api/v1.0/me/userPhoto
USER PEOPLE
GROUPS
7
Mail, calendar and conversations
Exchange REST API https://outlook.office365.com/api/v1.0/me/Messageshttps://outlook.office365.com/api/v1.0/me/Events
USEREMAIL AND
CONVERSATIONS EVENTS GROUPS
8
Files
OneDrive for Business/SharePoint Files API https://contoso-my.sharepoint.com/personal/roys_harmon_ie/_api/v1.0/fileshttps://contoso.sharepoint.com/sites/designCouncil/_api/v1.0/files
USER FILES PEOPLE
GROUPS
9
Office Graph
Office Graph in SharePoint Online https://contoso.sharepoint.com/_api/search/query?Querytext='*'&Properties='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
USER FILES PEOPLE
10
USERS FILES MAIL CALENDAR TASKSGROUPS
Microsoft Graph API (graph.microsoft.com)
Microsoft Graph rich relationships and insights
Your App
11
• Separate API for Work/Personal services• Separate oAuth stacks for Work/Personal services
Ability to tap into consumer market:Before the Microsoft Graph
Work and school Personal
12
Today’s world with Microsoft Graph
Microsoft Graph https://graph.microsoft.com
Work and school Personal
…13
userPhoto
/me
department
mobile
aboutMebirthday
tags
hireDatethumbnailPhotoaddressjobTitlenamealiaspastProjectsresponsibilitiesschoolsskills
USER
CodeGET https://graph.microsoft.com/v1.0/me
GET https://graph.microsoft.comv/v1.0/users/<id>
GET https://graph.microsoft.com/v1.0/users/[email protected]?$select=skills
GET https://graph.microsoft.com/v1.0/me/photo/$value
manager
directReport
s
GROUPS
memberOf
USER
/users
16
CodeGET https://graph.microsoft.com/me/manager
GET https://graph.microsoft.com/me/directReports
GET https://graph.microsoft.com/me/memberOf
GET https://graph.microsoft.com/users/<id>
GET https://graph.microsoft.com/users/[email protected]/directReports
manager
directReport
s
GROUPS
memberOf
/messages
MESSAGES
USER
18
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]"
MESSAGES
manager
directReport
s
GROUPS
memberOf
/events
MESSAGES
EVENTSUSER
20
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=2016-11-01t01:00:00z&enddatetime=2016-11-16t23:00:00z
EVENTS
MESSAGES
manager
directReport
s
GROUPS
memberOf
/files
EVENTS
Shared with me
modifiedByFILE
S
createdBy
directReports
USERpublic
22
CodeGET https://graph.microsoft.com/v1.0/me/drives
GET https://graph.microsoft.com/v1.0/me/drives/<id>
GET https://graph.microsoft.com/v1.0/me/drive/items/<id>/lastModifiedByUser
GET https://graph.microsoft.com/v1.0/users/[email protected]/drives
GET https://graph.microsoft.com/v1.0/users/[email protected]/drive/items/<id>/lastModifiedByUser/manager
directReport
s
Shared with me
modifiedByFILE
S
createdBy
directReports
public
EVENTS
MESSAGES
manager
GROUPS
memberOf
/groups
directReport
s
Shared with me
modifiedByFILE
S
createdBy
directReports
public
createdBy
FILES
CONVERSATIONS
EVENTS
GROUPS
memberOf
USER
24
CodeGET https://graph.microsoft.com/v1.0/groups
GET https://graph.microsoft.com/v1.0/groups/<id>/members
GET https://graph.microsoft.com/v1.0/groups/<id>/drive
GET https://graph.microsoft.com/v1.0/groups/<id>/conversations
GET https://graph.microsoft.com/v1.0/groups/<id>/events/<id>/accept
1. Get a tenant-level entity set: /user
2. Select a member from the entity set: /user/{id}
3. Get an entity property:/user/{id}/department
4. Traverse to related entity type via navigation properties: /user/{id}/drives
Navigating the APIhttps://graph.microsoft.com
//{version}/{tenant}/{entity-set}
/{id}
/{property}
26
UX = Look & Feel
27
Look
Clean, modern UI
Feel
“Joy of Use”“Great Experience”
+ = Intelligent Apps
Increase Joy, Great UX
From Business Apps to Intelligent Apps
28
Top Down:
Identify key use cases and augment with insights
from the graph
Two approaches
Bottom up:
Identify useful APIs and then employ them to
enrich your app
Building Intelligent Apps – Scenario #1Saving Documents in (Document) Libraries
Old way:
Offer intuitive navigationtools to user
Intelligent app:
Old way +suggestions from the
graph
29
workingWith
workingWith
createdBy
FILES
CONVERSATIONS
EVENTS
GROUPS
memberOf
directReport
s
Shared with me
modifiedByFILE
S
createdBy
directReports
public
EVENTS
MESSAGES
manager
GROUPS
memberOf
workingWith
workingWith
recent
trendingAround
directReports
/recent
USER
30
CodeGET https://graph.microsoft.com/v1.0/me/drive/recent
GET https://graph.microsoft.com/v1.0/users/<id>/drive/recent
Building Intelligent Apps – Scenario #2Recommend content
Old way:
Task-dedicated app
New way:
Use of ‘Trending Around Me’ from the graph to improve engagement
32
workingWith
workingWith
createdBy
FILES
CONVERSATIONS
EVENTS
GROUPS
memberOf
directReport
s
Shared with me
modifiedByFILE
S
createdBy
directReports
public
EVENTS
MESSAGES
manager
GROUPS
memberOf
workingWith
workingWith
trendingAround
trendingAround
directReports
/trendingAround
USER
33
CodeGET https://graph.microsoft.com/beta/me/trendingAround
GET https://graph.microsoft.com/beta/contoso.com/users/[email protected]/trendingAround
Building Intelligent Apps – Scenario #3Contacting Colleagues
Old way:
Seek and find the contact alphabetically
New way:
Use ‘affinity’ from the graph to suggest “close”
contacts
35
createdBy
FILES
CONVERSATIONS
EVENTS
GROUPS
memberOf
directReport
s
Shared with me
modifiedByFILE
S
createdBy
directReports
public
EVENTS
MESSAGES
manager
GROUPS
memberOf
/workingWith
createdBy
FILES
CONVERSATIONS
EVENTS
GROUPS
memberOf
workingWith
workingWithUSER
36
CodeGET https://graph.microsoft.com/beta/me/workingWith
GET https://graph.microsoft.com/beta/users/[email protected]/workingWith
Extending the GraphPOST https://graph.microsoft.com/v1.0/me/contacts/<contactId>/extensions{ "@odata.type": "microsoft.graph.openTypeExtension", "ExtensionName": "Com.Contoso.OpportunityManager", "CompanyName": "Alpine Skis", "URL": "https://contoso.sales.com/opportunities/6389346343848"}
GET https://graph.microsoft.com/v1.0/me/contacts/<contactId>/ extensions/Com.Contoso.OpportunityManager
38
Extend Graph with Business data
39
Beyond the Microsoft Graph
Using Graph data to get insights for other services
40
Building your own graph
41
Thank You!
Contact me: @roysheinfeld or [email protected]