SlideShare a Scribd company logo
Everything you need to know about the
Microsoft Graph as a SharePoint Developer
Sébastien Levert
Hi! I’m Seb!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
Agenda
Introduction
Building integration with Office 365
What is the Microsoft Graph?
Single endpoint for:
1 - Accessing data
/me, /users, /groups, /messages, /drive, ….
2 -Traversing data
/drive/<id>/lastmodifiedByUser
3 - Accessing insights
/me/insights/trending
4-Work/School and Personal
https://graph.microsoft.com/
Use the 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
Authentication & Authorization
Azure AD Application
• Proxy to you Office 365 data
• Enable user-consent to be
transparent with the way the
application will play with the data
• Secure protocol
• No capturing user credentials
• Fine-grained access scopes
• Long-term access through refresh
tokens
Permissions
• Application permissions
• Act on the Microsoft Graph as a Deamon
• Authentication is certificate-based
• Delegated permissions
• Act on the Microsoft Graph as an authenticated user
• 60+ delegated permissions
• Does not replace the actual permissions on the data
Implicit Flow
Azure AD
Client Application Microsoft Graph
1
2
3
4
Token
Token
Ressources
Let’s play
Acting on the graph
• Getting Graph data
• Creating Graph data
• Updating Graph data
• Deleting Graph data
• Executing actions on the Graph
Acting on the Graph
GET https://graph.microsoft.com/v1.0/me
POST https://graph.microsoft.com/v1.0/groups
{
…
}
PATCH https://graph.microsoft.com/v1.0/groups/<id>
DELETE https://graph.microsoft.com/v1.0/groups/<id>
POST https://graph.microsoft.com/v1.0/me/sendMail
Exploring the Graph
• Using the Graph Explorer
• Using REST HTTP Calls
• Using .NET
• Using PnP PowerShell
• Using JavaScript
• Using the SDKs
Using the Graph Explorer
Using REST HTTP Calls
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25j…
Accept: application/json
GET https://graph.microsoft.com/v1.0/me
GET https://graph.microsoft.com/v1.0/me/messages
GET https://graph.microsoft.com/v1.0/me/drive/root/children
GET
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/a
ny(c:c+eq+'Unified')
GET https://graph.microsoft.com/beta/me/trendingAround
GET https://graph.microsoft.com/beta/me/plans
Using REST HTTP Calls (SharePoint)
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25j…
Accept: application/json
GET https://graph.microsoft.com/beta/sharePoint/sites
GET https://graph.microsoft.com/beta/sharePoint/site
GET https://graph.microsoft.com/beta/sharePoint:/site/lab
GET https://graph.microsoft.com/beta/sharePoint/site/lists
GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/items
GET https://graph.microsoft.com/beta/sharePoint/site/drives
GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/drive
GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/drive/root/children
Using .NET
var me = graphServiceClient.Me.Request().GetAsync();
var calendar = await graphServiceClient
.Me
.Calendar
.Request()
.Select("id")
.GetAsync();
var children = await graphServiceClient
.Me
.Drive
.Root
.Children
.Request()
.Expand("thumbnails")
.GetAsync();
Using PnP PowerShell
Connect-PnPMicrosoftGraph -Scopes @("Group.ReadWrite.All")
$group = New-PnPUnifiedGroup -DisplayName "SPFest Seattle" `
-Description "SPFest Seattle" `
-MailNickname "spfest-seattle"
Get-PnPUnifiedGroup –Identity "SPFest Seattle"
Remove-PnPUnifiedGroup -Identity $group.GroupId
Using JavaScript
// construct the email object
const mail = {
subject: "Microsoft Graph JavaScript Sample",
toRecipients: [{
emailAddress: {
address: "example@example.com"
}
}],
body: {
content: "<h1>MicrosoftGraph JavaScript Sample</h1>Check out https://github.com/microsoftgraph/msgraph-
sdk-javascript",
contentType: "html"
}
}
client
.api('/users/me/sendMail')
.post({message: mail}, (err, res) => {
console.log(res)
})
Using the SDKs
Be notified by the Graph
• Webhooks
Creating a webhook on the Graph
POST https://graph.microsoft.com/beta/subscriptions
{
"changeType": "Created",
"notificationUrl": "https://<url>/api/webhookCallback",
"resource": "me/messages"
}
Being notified from a webhook
POST https://<url>/api/webhookCallback
{
"value":[
{
"subscriptionId":"7f105c7d-2dc5-4530-97cd-4e7af6534c07",
"subscriptionExpirationDateTime":"2015-11-20T18:23:45.9356913Z",
"changeType":"Created",
"resource":"Users/<user-id>/messages/<message-id>",
"resourceData":{
"@odata.type":"#Microsoft.Graph.Message",
"@odata.id":"Users/<user-id>/messages/<message-id>",
"@odata.etag":"W/"CQAAABYAAACoeN6SYXGLRrvRm+CYrrfQAACvvGdb"",
"Id“:"<message-id>"
}
}
]
}
Extending the Graph
• Open type extensions
• Schema extensions
Open type extensions
POST https://graph.microsoft.com/beta/me/contacts/ID/extensions
{
"@odata.type": "Microsoft.Graph.OpenTypeExtension",
"extensionName": "Contacts.Extensions.LinkedIn",
"linkedInUrl": "https://www.linkedin.com/in/seb/"
}
Getting the value of an OpenType
GET
https://graph.microsoft.com/beta/me/contacts/ID?expand=Extensions($filter=Id
eq 'Contacts.Extensions.LinkedIn')
{
…
"extensions": [
{
"@odata.type": "#microsoft.graph.openTypeExtension",
"extensionName": "Contacts.Extensions.LinkedIn",
"linkedInUrl": https://www.linkedin.com/in/seb/
}
]
}
Defining a schema extension
POST https://graph.Microsoft.com/beta/schemaExtensions
{
"id": "linkedin_information",
"description": "All information about LinkedIn account",
"targetType": ["Contacts"],
"available": "Online",
"properties" : [
"name": "linkedInUrl",
"type": "String"
]
}
Adding a schema extension data
POST https://graph.microsoft.com/beta/me/contacts/ID
{
"linkedin_information": {
"linkedInUrl": "https://www.linkedin.com/in/seb/"
}
}
Next Steps
Resources
• https://dev.office.com
• https://graph.microsoft.io
• https://channel9.msdn.com/Events/Connect/2016/213
• https://techcommunity.microsoft.com/t5/Microsoft-Ignite-
Content/BRK4016-Access-SharePoint-files-and-lists-using-
SharePoint-API/td-p/10403
• https://mva.microsoft.com/product-training/office-development
Samples
• https://github.com/SharePoint/PnP-PowerShell
• https://github.com/microsoftgraph/msgraph-sdk-javascript
• https://github.com/microsoftgraph/aspnet-webhooks-rest-sample
• https://github.com/sebastienlevert/officehub
Share your experience
• Use hashtags to share your experience
• #Office365Dev
• #MicrosoftGraph
• Contribute and ask question to the MicrosoftTech Community
• https://slevert.me/tech-community-sp-dev
• Log issues & questions to the GitHub Repositories
Thank you!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at

More Related Content

PPTX
SharePoint Fest DC - Everything your need to know about the Microsoft Graph a...
PPTX
SPS Utah - Everything your need to know about the Microsoft Graph as a ShareP...
PPTX
SharePoint Fest DC 2018 - Everything your need to know about the Microsoft Gr...
PPTX
An introduction to Microsoft Graph for developers
PPTX
Microsoft Graph API - A Single Stop For Your Cloud Solution
PPTX
Microsoft Graph: Connect to essential data every app needs
PPTX
SharePoint 2010 Tools in Visual Studio 2010
PPTX
Developing With Data Technologies
SharePoint Fest DC - Everything your need to know about the Microsoft Graph a...
SPS Utah - Everything your need to know about the Microsoft Graph as a ShareP...
SharePoint Fest DC 2018 - Everything your need to know about the Microsoft Gr...
An introduction to Microsoft Graph for developers
Microsoft Graph API - A Single Stop For Your Cloud Solution
Microsoft Graph: Connect to essential data every app needs
SharePoint 2010 Tools in Visual Studio 2010
Developing With Data Technologies

What's hot (20)

PPTX
LUIS and Bots
PPTX
Developing a Provider Hosted SharePoint app
PPTX
Office Dev Day 2018 - Extending Microsoft Teams
PDF
Spunite17 Converting your CEWP Customisations
PPTX
Built Forms, Lists & Workflows with the IBM Forms Experience Builder (FEB) fo...
PPTX
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
PPTX
Windows Azure SQL Database Federations
PDF
2014-03-20 - Baltimore SharePoint Users Group - Getting Started with Office 365
PPTX
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
PPTX
Microsoft Teams as a Development Platform
PPTX
How to (remote) control Office 365 with Azure (SharePoint Konferenz ppEDV Erd...
PPTX
Collaboration Throwdown: Salesforce verses SharePoint
PPTX
SharePoint Development For Asp Net Developers
PPTX
Microsoft identity platform developer community call-October 2019
PPTX
SharePoint 2010 Development for ASP.NET Developers - SharePoint Saturday Hous...
PPTX
Share Point For Beginners V1
PPTX
CAT Release August 2015
PPTX
Developer’s Independence Day: Introducing the SharePoint App Model
PPTX
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
PPTX
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
LUIS and Bots
Developing a Provider Hosted SharePoint app
Office Dev Day 2018 - Extending Microsoft Teams
Spunite17 Converting your CEWP Customisations
Built Forms, Lists & Workflows with the IBM Forms Experience Builder (FEB) fo...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Windows Azure SQL Database Federations
2014-03-20 - Baltimore SharePoint Users Group - Getting Started with Office 365
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Microsoft Teams as a Development Platform
How to (remote) control Office 365 with Azure (SharePoint Konferenz ppEDV Erd...
Collaboration Throwdown: Salesforce verses SharePoint
SharePoint Development For Asp Net Developers
Microsoft identity platform developer community call-October 2019
SharePoint 2010 Development for ASP.NET Developers - SharePoint Saturday Hous...
Share Point For Beginners V1
CAT Release August 2015
Developer’s Independence Day: Introducing the SharePoint App Model
ESPC Teams week Microsoft Teams & Bot Framework – a Developer’s Perspective
SharePoint 2013 “App Model” Developing and Deploying Provider Hosted Apps
Ad

Similar to SharePoint Fest Seattle 2017 - Everything your need to know about the Microsoft Graph as a SharePoint Developer (20)

PPTX
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
PPTX
ATD 13 - Enhancing your applications using Microsoft Graph API
PPTX
Developing share point solutions with the microsoft graph
PPTX
Microsoft Graph
PPTX
Microsoft Graph community call-November 2018
PDF
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
PDF
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
PPTX
Microsoft Graph: Connect to essential data every app needs
PPTX
Building productivity solutions with Microsoft Graph
PPTX
SPKonferenz 2017 - Introducing SDKs for Microsoft Graph
PDF
Xamarin microsoft graph
PPSX
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
PPTX
Microsoft Graph Community call 1-2-18
PDF
Microsoft graph and power platform champ
PPTX
How to use Microsoft Graph in your applications
PPTX
#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...
PPTX
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
PPTX
Microsoft Graph Community call 2-6-18
PPTX
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
PPTX
#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
ATD 13 - Enhancing your applications using Microsoft Graph API
Developing share point solutions with the microsoft graph
Microsoft Graph
Microsoft Graph community call-November 2018
Create cross-platform apps that interact with Microsoft Graph and Office 365 ...
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
Microsoft Graph: Connect to essential data every app needs
Building productivity solutions with Microsoft Graph
SPKonferenz 2017 - Introducing SDKs for Microsoft Graph
Xamarin microsoft graph
Power of Microsoft Graph API by Nilesh Shah SharePoint Saturday Toronto 2017
Microsoft Graph Community call 1-2-18
Microsoft graph and power platform champ
How to use Microsoft Graph in your applications
#SPSToronto The SharePoint Framework and the Microsoft Graph on steroids with...
harePoint Framework Webinar Series: Consume Graph APIs in SharePoint Framework
Microsoft Graph Community call 2-6-18
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
#SPSottawa The SharePoint Framework and The Microsoft Graph on steroids with ...
Ad

More from Sébastien Levert (20)

PPTX
SharePoint Fest Chicago 2019 - Build a Full Intranet in 70 minutes
PPTX
SharePoint Fest Chicago 2019 - Building tailored search experiences in Modern...
PPTX
SharePoint Fest Chicago 2019 - From SharePoint to Office 365 Development
PPTX
ESPC19 - Supercharge Your Teams Experience with Advanced Development Techniques
PPTX
ESPC19 - Build Your First Microsoft Teams App Using SPFx
PPTX
SharePoint Fest Seattle 2019 - From SharePoint to Office 365 Development
PPTX
SharePoint Fest Seattle 2019 - Building tailored search experiences in Modern...
PPTX
SPC19 - Building tailored search experiences in Modern SharePoint
PPTX
SharePoint Fest 2019 - Build an intelligent application by connecting it to t...
PPTX
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
PPTX
SharePoint Fest DC 2019 - From SharePoint to Office 365 Development
PPTX
Webinar - 2020-03-24 - Build your first Microsoft Teams app using SPFx
PPTX
SPTechCon Austin 2019 - Top 10 feature trends to make you fall in love with y...
PPTX
SPTechCon Austin 2019 - From SharePoint to Office 365 development
PPTX
SharePoint Fest Chicago 2018 - From SharePoint to Office 365 development
PPTX
SharePoint Saturday Vienna 2018 - Top 10 feature trends to make you fall in l...
PPTX
SharePoint Saturday Vienna 2018 - Building a modern intranet in 60 minutes
PPTX
European SharePoint Conference 2018 - Build an intelligent application by con...
PPTX
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
PPTX
Nashville SharePoint User Group 2018 - Building a modern intranet in 60 minutes
SharePoint Fest Chicago 2019 - Build a Full Intranet in 70 minutes
SharePoint Fest Chicago 2019 - Building tailored search experiences in Modern...
SharePoint Fest Chicago 2019 - From SharePoint to Office 365 Development
ESPC19 - Supercharge Your Teams Experience with Advanced Development Techniques
ESPC19 - Build Your First Microsoft Teams App Using SPFx
SharePoint Fest Seattle 2019 - From SharePoint to Office 365 Development
SharePoint Fest Seattle 2019 - Building tailored search experiences in Modern...
SPC19 - Building tailored search experiences in Modern SharePoint
SharePoint Fest 2019 - Build an intelligent application by connecting it to t...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - From SharePoint to Office 365 Development
Webinar - 2020-03-24 - Build your first Microsoft Teams app using SPFx
SPTechCon Austin 2019 - Top 10 feature trends to make you fall in love with y...
SPTechCon Austin 2019 - From SharePoint to Office 365 development
SharePoint Fest Chicago 2018 - From SharePoint to Office 365 development
SharePoint Saturday Vienna 2018 - Top 10 feature trends to make you fall in l...
SharePoint Saturday Vienna 2018 - Building a modern intranet in 60 minutes
European SharePoint Conference 2018 - Build an intelligent application by con...
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
Nashville SharePoint User Group 2018 - Building a modern intranet in 60 minutes

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation theory and applications.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cuic standard and advanced reporting.pdf
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...

SharePoint Fest Seattle 2017 - Everything your need to know about the Microsoft Graph as a SharePoint Developer

  • 1. Everything you need to know about the Microsoft Graph as a SharePoint Developer Sébastien Levert
  • 2. Hi! I’m Seb! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
  • 6. What is the Microsoft Graph? Single endpoint for: 1 - Accessing data /me, /users, /groups, /messages, /drive, …. 2 -Traversing data /drive/<id>/lastmodifiedByUser 3 - Accessing insights /me/insights/trending 4-Work/School and Personal https://graph.microsoft.com/
  • 7. Use the 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
  • 9. Azure AD Application • Proxy to you Office 365 data • Enable user-consent to be transparent with the way the application will play with the data • Secure protocol • No capturing user credentials • Fine-grained access scopes • Long-term access through refresh tokens
  • 10. Permissions • Application permissions • Act on the Microsoft Graph as a Deamon • Authentication is certificate-based • Delegated permissions • Act on the Microsoft Graph as an authenticated user • 60+ delegated permissions • Does not replace the actual permissions on the data
  • 11. Implicit Flow Azure AD Client Application Microsoft Graph 1 2 3 4 Token Token Ressources
  • 13. Acting on the graph • Getting Graph data • Creating Graph data • Updating Graph data • Deleting Graph data • Executing actions on the Graph
  • 14. Acting on the Graph GET https://graph.microsoft.com/v1.0/me POST https://graph.microsoft.com/v1.0/groups { … } PATCH https://graph.microsoft.com/v1.0/groups/<id> DELETE https://graph.microsoft.com/v1.0/groups/<id> POST https://graph.microsoft.com/v1.0/me/sendMail
  • 15. Exploring the Graph • Using the Graph Explorer • Using REST HTTP Calls • Using .NET • Using PnP PowerShell • Using JavaScript • Using the SDKs
  • 16. Using the Graph Explorer
  • 17. Using REST HTTP Calls Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25j… Accept: application/json GET https://graph.microsoft.com/v1.0/me GET https://graph.microsoft.com/v1.0/me/messages GET https://graph.microsoft.com/v1.0/me/drive/root/children GET https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/a ny(c:c+eq+'Unified') GET https://graph.microsoft.com/beta/me/trendingAround GET https://graph.microsoft.com/beta/me/plans
  • 18. Using REST HTTP Calls (SharePoint) Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub25j… Accept: application/json GET https://graph.microsoft.com/beta/sharePoint/sites GET https://graph.microsoft.com/beta/sharePoint/site GET https://graph.microsoft.com/beta/sharePoint:/site/lab GET https://graph.microsoft.com/beta/sharePoint/site/lists GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/items GET https://graph.microsoft.com/beta/sharePoint/site/drives GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/drive GET https://graph.microsoft.com/beta/sharePoint/site/lists/<id>/drive/root/children
  • 19. Using .NET var me = graphServiceClient.Me.Request().GetAsync(); var calendar = await graphServiceClient .Me .Calendar .Request() .Select("id") .GetAsync(); var children = await graphServiceClient .Me .Drive .Root .Children .Request() .Expand("thumbnails") .GetAsync();
  • 20. Using PnP PowerShell Connect-PnPMicrosoftGraph -Scopes @("Group.ReadWrite.All") $group = New-PnPUnifiedGroup -DisplayName "SPFest Seattle" ` -Description "SPFest Seattle" ` -MailNickname "spfest-seattle" Get-PnPUnifiedGroup –Identity "SPFest Seattle" Remove-PnPUnifiedGroup -Identity $group.GroupId
  • 21. Using JavaScript // construct the email object const mail = { subject: "Microsoft Graph JavaScript Sample", toRecipients: [{ emailAddress: { address: "example@example.com" } }], body: { content: "<h1>MicrosoftGraph JavaScript Sample</h1>Check out https://github.com/microsoftgraph/msgraph- sdk-javascript", contentType: "html" } } client .api('/users/me/sendMail') .post({message: mail}, (err, res) => { console.log(res) })
  • 23. Be notified by the Graph • Webhooks
  • 24. Creating a webhook on the Graph POST https://graph.microsoft.com/beta/subscriptions { "changeType": "Created", "notificationUrl": "https://<url>/api/webhookCallback", "resource": "me/messages" }
  • 25. Being notified from a webhook POST https://<url>/api/webhookCallback { "value":[ { "subscriptionId":"7f105c7d-2dc5-4530-97cd-4e7af6534c07", "subscriptionExpirationDateTime":"2015-11-20T18:23:45.9356913Z", "changeType":"Created", "resource":"Users/<user-id>/messages/<message-id>", "resourceData":{ "@odata.type":"#Microsoft.Graph.Message", "@odata.id":"Users/<user-id>/messages/<message-id>", "@odata.etag":"W/"CQAAABYAAACoeN6SYXGLRrvRm+CYrrfQAACvvGdb"", "Id“:"<message-id>" } } ] }
  • 26. Extending the Graph • Open type extensions • Schema extensions
  • 27. Open type extensions POST https://graph.microsoft.com/beta/me/contacts/ID/extensions { "@odata.type": "Microsoft.Graph.OpenTypeExtension", "extensionName": "Contacts.Extensions.LinkedIn", "linkedInUrl": "https://www.linkedin.com/in/seb/" }
  • 28. Getting the value of an OpenType GET https://graph.microsoft.com/beta/me/contacts/ID?expand=Extensions($filter=Id eq 'Contacts.Extensions.LinkedIn') { … "extensions": [ { "@odata.type": "#microsoft.graph.openTypeExtension", "extensionName": "Contacts.Extensions.LinkedIn", "linkedInUrl": https://www.linkedin.com/in/seb/ } ] }
  • 29. Defining a schema extension POST https://graph.Microsoft.com/beta/schemaExtensions { "id": "linkedin_information", "description": "All information about LinkedIn account", "targetType": ["Contacts"], "available": "Online", "properties" : [ "name": "linkedInUrl", "type": "String" ] }
  • 30. Adding a schema extension data POST https://graph.microsoft.com/beta/me/contacts/ID { "linkedin_information": { "linkedInUrl": "https://www.linkedin.com/in/seb/" } }
  • 32. Resources • https://dev.office.com • https://graph.microsoft.io • https://channel9.msdn.com/Events/Connect/2016/213 • https://techcommunity.microsoft.com/t5/Microsoft-Ignite- Content/BRK4016-Access-SharePoint-files-and-lists-using- SharePoint-API/td-p/10403 • https://mva.microsoft.com/product-training/office-development
  • 33. Samples • https://github.com/SharePoint/PnP-PowerShell • https://github.com/microsoftgraph/msgraph-sdk-javascript • https://github.com/microsoftgraph/aspnet-webhooks-rest-sample • https://github.com/sebastienlevert/officehub
  • 34. Share your experience • Use hashtags to share your experience • #Office365Dev • #MicrosoftGraph • Contribute and ask question to the MicrosoftTech Community • https://slevert.me/tech-community-sp-dev • Log issues & questions to the GitHub Repositories
  • 35. Thank you! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at