SlideShare a Scribd company logo
1 of 51
From Event Receivers to SharePoint Webhooks
André Vala
GOLD
SILVERLOCATION
BRONZE
MEDIA
IT Deputy Director @ Pestana Hotel Group
Office Servers and Services MVP
SharePoint for 11+ years
Speaker & author
https://andrevala.com
/in/andrevala
@atomicvee
andre.vala@gmail.com
Event
Receivers Conclusions
3 SLIDES
LEVEL: 100
ALL
7 SLIDES
LEVEL: 200
DEV
15 SLIDES + 1 DEMO
LEVEL: 300
DEV
15 SLIDES + 1 DEMO
LEVEL: 300
DEV
7 SLIDES
LEVEL: 100
ALL
Remote
Event
Receivers
SharePoint
Webhooks
Event
Handling in
SharePoint
1
Respond to user actions and modifications to content
Add validation logic for columns on list items
Cleanup and format content as it is entered by users
Calculate and store aggregated values
Initialize a host web with new lists during add-in installation
2003 2007 2010 2013 2016
Server-Side Event Receivers
Remote Event Receivers
SharePoint Webhooks
2
Server-side event handling
Implemented using an event receiver class
Registration requires referencing of the event receiver class
Event receivers are deployed by SharePoint solution in a .NET
assembly
Loaded into SharePoint worker process
Executed before data is committed to the Content DB
Opportunity for pre-processing like validations
Opportunity to cancel the event
Run in the same process and thread that triggered the event
Block the execution of the current thread
UI will be held up
Avoid complex time-consuming processing logic
Executed after data is committed to the Content DB
Cannot be cancelled
Opportunity for post-processing like notifications
Run on a background thread and do not block the UI
This behaviour can be changed by updating the synchronization property of the the event
receiver to synchronous
Site/Web Events
Site Delete  
Web Delete  
Web Move  
Web Add (2010) 
Web Provision (2010) 


Feature Events
Feature Activate 
Feature Deactivate 
Feature Install 
Feature Uninstall 
Feature Upgrade 
Workflow Events
Workflow Start (2010)  
Workflow Postpone (2010) 
Workflow Complete (2010) 
Entity Instance Events
Entity Instance Add (2013) 
Entity Instance Delete (2013) 
Entity Instance Update
(2013)

Add-In Lifecycle Events
Add-In Install (2013) 
Add-In Upgrade (2013) 
Add-In Uninstall (2013) 
List Events
List Add (2010)  
List Delete (2010)  
Email Reception 
List Schema Events
Field Add  
Field Delete  
Field Update  
List Item Events
Item Add  
Item Delete  
Item Update  
Item Attachment Add  
Item Attachment Delete  
Item Check In  
Item Check Out  
Item Uncheck Out  
Item File Move  
Item File Convert 
Item Version Delete (2013)  
Security Events (2013)
Group Add  
Group Update  
Group Delete  
Group User Add  
Group User Delete  
Role Definition Add  
Role Definition Delete  
Role Definition Update  
Role Assignment Add  
Role Assignment Delete  
Role Assignment Update  
Break Inheritance  
Reset Inheritance  
Declaratively for List and Content Type binding
Using the object model for all bindings
SPWeb new SPSite "http://localhost"
SPEventReceiverDefinition
"Receiver.Class1"
"Receiver, Version=1.0.0.0, Culture=neutral, PublicKeyToken =10b23036c9b36d6d"
SPEventReceiverType
Inherit from one of the base classes
Override the corresponding event methods
3
Event handler code runs in remote web (not SharePoint)
SharePoint calls web service in remote web to trigger event
Must be accessible by anonymous users
Supported remote events are a subset of server-side events
Remote “before” events implemented as two-way events
Remote “after” events implemented as one-way events
Modeled as two-way events
Execution flow goes to remote web and then back to SharePoint
Client is blocked while event processing occurs in remote web
Sample execution flow for two-way event
1. Client attempts action which triggers an event (e.g. update item)
2. SharePoint host calls to web service in remote web
3. SharePoint host blocks until call returns from remote web
4. SharePoint host commits action and returns to Client
Two Way Event (aka before event)
Client
SharePoint
Host
Remote
Web
1 2
34
Modeled as one-way events
Execution flow goes to remote web but does not return
Unlike “before” events, after events do not block client response
Sample execution flow for one-way event
1. Client attempts action which triggers an event (e.g. update item)
2. SharePoint host commits action and returns to Client
3. SharePoint host executes one-way WCF call on remote web
One Way Event (aka after event)
Client
SharePoint
Host
Remote
Web
1
3
2
Site/Web Events
Site Delete  
Web Delete  
Web Move  
Web Add 
Web Provision 


Feature Events
Feature Activate
Feature Deactivate
Feature Install
Feature Uninstall
Feature Upgrade
Workflow Events
Workflow Start (2010)
Workflow Postpone (2010)
Workflow Complete (2010)
Entity Instance Events
Entity Instance Add  
Entity Instance Delete  
Entity Instance Update  
Add-In Lifecycle Events
Add-In Install 
Add-In Upgrade 
Add-In Uninstall 
List Events
List Add  
List Delete  
Email Reception
List Schema Events
Field Add  
Field Delete  
Field Update  
List Item Events
Item Add  
Item Delete  
Item Update  
Item Attachment Add  
Item Attachment Delete  
Item Check In  
Item Check Out  
Item Uncheck Out  
Item File Move  
Item File Convert 
Item Version Delete  
Security Events
Group Add  
Group Update  
Group Delete  
Group User Add  
Group User Delete  
Role Definition Add  
Role Definition Delete  
Role Definition Update  
Role Assignment Add  
Role Assignment Delete  
Role Assignment Update  
Break Inheritance  
Reset Inheritance  
Event receivers must be registered with SharePoint host
Registration can be declarative with XML for events occurring in app web
Registration for events occurring in host web requires writing procedural code
Remote event receiver implemented with .svc file
Event receiver code written as C# code code-behind .svc file
Event receiver is a class that implements IRemoteEventService
ProcessEvent method executes when two-way event is triggered
ProcessOneWayEvent method executes when one-way event is triggered
Passed as parameter
Provides you with contextual information about the current event
Makes it possible to determine event type and event target object
Makes it possible to read user input to perform validation
ProcessEvent must return SPRemoteEventResult object
Makes it possible to cancel user action when user input is invalid
Makes it possible to update user input when processing a “before” event
SharePoint add-in model support add-in events
Add-in events for installation, upgrade and uninstall
Added to add-in project using property sheet
Implemented as a remote event receiver
App Installed event
App Installed event must complete within 30 seconds
SharePoint will call the receiver 3 times before failing
Declaratively registered in AppManifest.xml
Debugging in Office 365
Addresses with http://localhost will not work
You must use a Azure Relay to expose your service
Visual Studio has native support for debugging via Azure Relay (previously Azure Services Bus)
SharePoint Webhooks
4
A way to be notified of a done change
Push model instead of Pull model
Universal model used by many services (WordPress, GitHub,
MailChimp, ...)
First made available in OneDrive and Outlook
Now available in SharePoint Online
POST /_api/web/lists('list-id')/subscriptions
Application
Content-Type: application/json
{
"resource": "https://contoso.sharepoint.com/_api/web/lists({id})",
"notificationUrl": "https://{your host}/your/webhook/service",
"expirationDateTime": "2017-06-18T16:17:57+00:00"
}
SharePoint
Service
Application
Your WebHook
notification
service endpoint
POST https://{your host}/your/webhook/service
?validationToken={randomString}
SharePoint
Service
Application
Your WebHook
notification
service endpoint
Content-Type: text/plain
{randomString}
HTTP/1.1 200 OK
SharePoint
Service
SharePoint
Service
Application
Your WebHook
notification
service endpoint
Content-Type: application/json
{
"id": "a8e6d5e6-9f7f-497a-b97f-8ffe8f559dc7",
"expirationDateTime": "2017-06-18T16:17:57Z",
"notificationUrl": "https://{your host}/your/webhook/service",
"resource": "{id}"
}
HTTP/1.1 201 Created
Application
SharePoint
Service
Your WebHook
notification
service endpoint
{
"value":[
{
"subscriptionId":"91779246-afe9-4525-b122-6c199ae89211",
"clientState":"00000000-0000-0000-0000-000000000000",
"expirationDateTime":"2017-06-18T17:27:00.0000000Z",
"resource":"b9f6f714-9df8-470b-b22e-653855e1c181",
"tenantId":"00000000-0000-0000-0000-000000000000",
"siteUrl":"/",
"webId":"dbc5a806-e4d4-46e5-951c-6344d70b62fa"
}
]
}
POST https://{your host}/your/webhook/service
SharePoint
Service
Your WebHook
notification
service endpoint
HTTP/1.1 200 OK
SharePoint
Service
Your WebHook
notification
service endpoint
HTTP/1.1 200 OK
POST https://{your host}/your/webhook/service
Storage Queue
WebJob
SharePoint
Service
Your WebHook
notification
service endpoint
Application
Storage Queue WebJob
SQL Azure DB
POST https://{your host}/your/webhook/service
POST /_api/web/lists('list-id')/subscriptions
Grab “CurrentChangeToken” from list
Persist token per
subscription
Persist last used token per subscription
Grab change token from DB
Site/Web Events
Site Delete
Web Delete
Web Move
Web Add
Web Provision


Feature Events
Feature Activate
Feature Deactivate
Feature Install
Feature Uninstall
Feature Upgrade
Workflow Events
Workflow Start (2010)
Workflow Postpone (2010)
Workflow Complete (2010)
Entity Instance Events
Entity Instance Add
Entity Instance Delete
Entity Instance Update
Add-In Lifecycle Events
Add-In Install
Add-In Upgrade
Add-In Uninstall
List Events
List Add
List Delete
Email Reception
List Schema Events
Field Add
Field Delete
Field Update
List Item Events
Item Add 
Item Delete 
Item Update 
Item Attachment Add 
Item Attachment Delete 
Item Check In 
Item Check Out 
Item Uncheck Out 
Item File Move 
Item File Convert 
Item Version Delete 
Security Events
Group Add
Group Update
Group Delete
Group User Add
Group User Delete
Role Definition Add
Role Definition Delete
Role Definition Update
Role Assignment Add
Role Assignment Delete
Role Assignment Update
Break Inheritance
Reset Inheritance
WebHooks have a retry mechanism with an incremental back off
strategy (5 times with 5 minute interval)
WebHook calls are less taxing for your service endpoint
The WebHook payload is very small
Notifications are batched because processing depends on the CSOM GetChanges() call
WebHooks are more secure as no event information is passed
along during the notification
WebHooks are easier to consume by “non-SharePoint” developers
No WCF based endpoints, regular HTTP services are sufficient (e.g.
Web API)
WebHooks have an expiration date of maximum 6 months after
creation
You can “renew” a WebHook via a REST call
PATCH /_api/web/lists('list-id')/subscriptions('subscriptionID')
Two patterns are possible:
Have a background job that regularly renews the needed subscriptions (recommended model)
Renew at notification time (will drop WebHook if there’s no event within the defined expiration
window)
Connect remote debugger to your service and web job running
in Azure
Use ngrok (https://ngrok.com/) as alternative to create a tunnel
to your service running on localhost
SharePoint List Webhooks
DEMO
Conclusions
5
Event Receivers Remote Event
Receivers
WebHooks
SharePoint Server 2003 
SharePoint Server 2007 
SharePoint Server 2010 
SharePoint Server 2013  
SharePoint Server 2016  
SharePoint Online  
Event Receivers Remote Event
Receivers
WebHooks
Site/Web events  
List events  
List schema events  
List item events   
Workflow events 
Security events  
Add-in events  
Feature events 
Event Receivers Remote Event Receivers WebHooks
Easy to develop   
Event registration   
Event type coverage   
Security   
Robustness   
Compatibility   
Future proof   
Overall   
Remote Event Receivers are here to stay
Use Webhooks if
Developing exclusively for SharePoint Online (currently)
Just need to handle list item events (currently)
Want to leverage automatic retries
Want to leverage increased security
Use Remote Event Receivers if
Targeting SharePoint On-Prem (2013 or later)
Need to handle events other than list item events
Use Server-side Event Receivers if
Targeting older versions of SharePoint (before 2013)
GOLD
SILVERLOCATION
BRONZE
MEDIA
From Event Receivers to SharePoint Webhooks (SPS Lisbon 2017)

More Related Content

What's hot

Office 365 directory synchronization - SPSDC Reston
Office 365 directory synchronization - SPSDC RestonOffice 365 directory synchronization - SPSDC Reston
Office 365 directory synchronization - SPSDC Restonamitvasu
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...Sébastien Levert
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Tech Community
 
Suguk activity feed
Suguk activity feedSuguk activity feed
Suguk activity feedWes Hackett
 
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013NCCOMMS
 
Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft 365 Developer
 
Office 365 Directory Synchronization
Office 365 Directory SynchronizationOffice 365 Directory Synchronization
Office 365 Directory Synchronizationamitvasu
 
ECS19 - Dragan Panjkov - Connecting Enterprise Software With Flow
ECS19 - Dragan Panjkov - Connecting Enterprise Software With FlowECS19 - Dragan Panjkov - Connecting Enterprise Software With Flow
ECS19 - Dragan Panjkov - Connecting Enterprise Software With FlowEuropean Collaboration Summit
 
SPUnite17 Building Great Client Side Web Parts with SPFx
SPUnite17 Building Great Client Side Web Parts with SPFxSPUnite17 Building Great Client Side Web Parts with SPFx
SPUnite17 Building Great Client Side Web Parts with SPFxNCCOMMS
 
Spsct15 power shell_csom - amit vasu
Spsct15 power shell_csom - amit vasuSpsct15 power shell_csom - amit vasu
Spsct15 power shell_csom - amit vasuamitvasu
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidKris Wagner
 
Getting started with ms graph api
Getting started with ms graph apiGetting started with ms graph api
Getting started with ms graph apiJasjit Chopra
 
Spsdc 2014 o365_power_shell_csom_amitv
Spsdc 2014 o365_power_shell_csom_amitvSpsdc 2014 o365_power_shell_csom_amitv
Spsdc 2014 o365_power_shell_csom_amitvamitvasu
 
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechConBuilding Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechConSPTechCon
 
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s Tour
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s TourECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s Tour
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s TourEuropean Collaboration Summit
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsRandy Williams
 
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabConfigure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabVinh Nguyen
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewRob Windsor
 

What's hot (20)

Developing With Data Technologies
Developing With Data TechnologiesDeveloping With Data Technologies
Developing With Data Technologies
 
Office 365 directory synchronization - SPSDC Reston
Office 365 directory synchronization - SPSDC RestonOffice 365 directory synchronization - SPSDC Reston
Office 365 directory synchronization - SPSDC Reston
 
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...SharePoint Saturday Chicago - Everything your need to know about the Microsof...
SharePoint Saturday Chicago - Everything your need to know about the Microsof...
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
 
Suguk activity feed
Suguk activity feedSuguk activity feed
Suguk activity feed
 
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
SPCA2013 - Developing Provider-Hosted Apps for SharePoint 2013
 
Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019Microsoft identity platform developer community call-October 2019
Microsoft identity platform developer community call-October 2019
 
Office 365 Directory Synchronization
Office 365 Directory SynchronizationOffice 365 Directory Synchronization
Office 365 Directory Synchronization
 
ECS19 - Dragan Panjkov - Connecting Enterprise Software With Flow
ECS19 - Dragan Panjkov - Connecting Enterprise Software With FlowECS19 - Dragan Panjkov - Connecting Enterprise Software With Flow
ECS19 - Dragan Panjkov - Connecting Enterprise Software With Flow
 
SPUnite17 Building Great Client Side Web Parts with SPFx
SPUnite17 Building Great Client Side Web Parts with SPFxSPUnite17 Building Great Client Side Web Parts with SPFx
SPUnite17 Building Great Client Side Web Parts with SPFx
 
Spsct15 power shell_csom - amit vasu
Spsct15 power shell_csom - amit vasuSpsct15 power shell_csom - amit vasu
Spsct15 power shell_csom - amit vasu
 
Hooking SharePoint APIs with Android
Hooking SharePoint APIs with AndroidHooking SharePoint APIs with Android
Hooking SharePoint APIs with Android
 
Getting started with ms graph api
Getting started with ms graph apiGetting started with ms graph api
Getting started with ms graph api
 
Spsdc 2014 o365_power_shell_csom_amitv
Spsdc 2014 o365_power_shell_csom_amitvSpsdc 2014 o365_power_shell_csom_amitv
Spsdc 2014 o365_power_shell_csom_amitv
 
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechConBuilding Apps for SharePoint 2013 by Andrew Connell - SPTechCon
Building Apps for SharePoint 2013 by Andrew Connell - SPTechCon
 
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s Tour
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s TourECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s Tour
ECS19 - Mike Ammerlaan - The Microsoft 365 Platform: A Developer’s Tour
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
 
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabConfigure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
Getting Started with the Office 365 API
Getting Started with the Office 365 APIGetting Started with the Office 365 API
Getting Started with the Office 365 API
 

Similar to From Event Receivers to SharePoint Webhooks (SPS Lisbon 2017)

Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...BlueMetalInc
 
HTML5 Server Sent Events/JSF JAX 2011 Conference
HTML5 Server Sent Events/JSF  JAX 2011 ConferenceHTML5 Server Sent Events/JSF  JAX 2011 Conference
HTML5 Server Sent Events/JSF JAX 2011 ConferenceRoger Kitain
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and BeyondMarakana Inc.
 
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)serge luca
 
ESPC18 Copenhagen session : Energize your application developments with micro...
ESPC18 Copenhagen session : Energize your application developments with micro...ESPC18 Copenhagen session : Energize your application developments with micro...
ESPC18 Copenhagen session : Energize your application developments with micro...serge luca
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Paco de la Cruz
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Lou Sacco
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Kashif Imran
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Wes Yanaga
 
Microsoft Graph API with OutSystems Event Subscriptions
Microsoft Graph API with OutSystems Event SubscriptionsMicrosoft Graph API with OutSystems Event Subscriptions
Microsoft Graph API with OutSystems Event SubscriptionsStefan Weber
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
Workflow Management with Espresso Workflow
Workflow Management with Espresso WorkflowWorkflow Management with Espresso Workflow
Workflow Management with Espresso WorkflowRolf Kremer
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream ProcessingGuido Schmutz
 
Push to the limit - rich and pro-active user interfaces with ADF (Oracle Ope...
Push to the limit - rich and pro-active user interfaces with ADF  (Oracle Ope...Push to the limit - rich and pro-active user interfaces with ADF  (Oracle Ope...
Push to the limit - rich and pro-active user interfaces with ADF (Oracle Ope...Lucas Jellema
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Igor Moochnick
 

Similar to From Event Receivers to SharePoint Webhooks (SPS Lisbon 2017) (20)

Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
Apps 101 - Moving to the SharePoint 2013 App Model - Presented 7/27/13 at Sha...
 
HTML5 Server Sent Events/JSF JAX 2011 Conference
HTML5 Server Sent Events/JSF  JAX 2011 ConferenceHTML5 Server Sent Events/JSF  JAX 2011 Conference
HTML5 Server Sent Events/JSF JAX 2011 Conference
 
Sharepoint Online
Sharepoint OnlineSharepoint Online
Sharepoint Online
 
PDC Highlights
PDC HighlightsPDC Highlights
PDC Highlights
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and Beyond
 
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)
Microsoft flow best practices SharePoint Saturday Bremen 2019 (Germany)
 
Ondemand scaling-aws
Ondemand scaling-awsOndemand scaling-aws
Ondemand scaling-aws
 
MS flow.docx
MS flow.docxMS flow.docx
MS flow.docx
 
ESPC18 Copenhagen session : Energize your application developments with micro...
ESPC18 Copenhagen session : Energize your application developments with micro...ESPC18 Copenhagen session : Energize your application developments with micro...
ESPC18 Copenhagen session : Energize your application developments with micro...
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
 
Microsoft Graph API with OutSystems Event Subscriptions
Microsoft Graph API with OutSystems Event SubscriptionsMicrosoft Graph API with OutSystems Event Subscriptions
Microsoft Graph API with OutSystems Event Subscriptions
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Workflow Management with Espresso Workflow
Workflow Management with Espresso WorkflowWorkflow Management with Espresso Workflow
Workflow Management with Espresso Workflow
 
Introduction to Stream Processing
Introduction to Stream ProcessingIntroduction to Stream Processing
Introduction to Stream Processing
 
Push to the limit - rich and pro-active user interfaces with ADF (Oracle Ope...
Push to the limit - rich and pro-active user interfaces with ADF  (Oracle Ope...Push to the limit - rich and pro-active user interfaces with ADF  (Oracle Ope...
Push to the limit - rich and pro-active user interfaces with ADF (Oracle Ope...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 

More from André Vala

RGPD - Testemunho do Mundo Real
RGPD - Testemunho do Mundo RealRGPD - Testemunho do Mundo Real
RGPD - Testemunho do Mundo RealAndré Vala
 
SharePoint - Presente e Futuro
SharePoint - Presente e FuturoSharePoint - Presente e Futuro
SharePoint - Presente e FuturoAndré Vala
 
Soluções com Office Graph
Soluções com Office GraphSoluções com Office Graph
Soluções com Office GraphAndré Vala
 
Host-Named Site Collections in SharePoint 2013
Host-Named Site Collections in SharePoint 2013Host-Named Site Collections in SharePoint 2013
Host-Named Site Collections in SharePoint 2013André Vala
 
User License Enforcement em SharePoint 2013
User License Enforcement em SharePoint 2013User License Enforcement em SharePoint 2013
User License Enforcement em SharePoint 2013André Vala
 
How To Use Host-Named Site Collections
How To Use Host-Named Site CollectionsHow To Use Host-Named Site Collections
How To Use Host-Named Site CollectionsAndré Vala
 
Novidades na pesquisa no SharePoint 2013
Novidades na pesquisa no SharePoint 2013Novidades na pesquisa no SharePoint 2013
Novidades na pesquisa no SharePoint 2013André Vala
 
Building Public Web Sites in SharePoint 2010
Building Public Web Sites in SharePoint 2010 Building Public Web Sites in SharePoint 2010
Building Public Web Sites in SharePoint 2010 André Vala
 
SharePoint + Azure = Better Together
SharePoint + Azure = Better TogetherSharePoint + Azure = Better Together
SharePoint + Azure = Better TogetherAndré Vala
 
Federated Authentication in SharePoint 2010
Federated Authentication in SharePoint 2010Federated Authentication in SharePoint 2010
Federated Authentication in SharePoint 2010André Vala
 
Using BCS to integrate Azure Services with SharePoint 2010
Using BCS to integrate Azure Services with SharePoint 2010Using BCS to integrate Azure Services with SharePoint 2010
Using BCS to integrate Azure Services with SharePoint 2010André Vala
 
LINQ to SharePoint
LINQ to SharePointLINQ to SharePoint
LINQ to SharePointAndré Vala
 
Solução de Negócio baseadas em Office 2010 e SharePoint 2010
Solução de Negócio baseadas em Office 2010 e SharePoint 2010Solução de Negócio baseadas em Office 2010 e SharePoint 2010
Solução de Negócio baseadas em Office 2010 e SharePoint 2010André Vala
 
SharePoint Deployment
SharePoint DeploymentSharePoint Deployment
SharePoint DeploymentAndré Vala
 
Microsoft Planner Deep Dive
Microsoft Planner Deep DiveMicrosoft Planner Deep Dive
Microsoft Planner Deep DiveAndré Vala
 
Office 365 Groups Deep Dive
Office 365 Groups Deep DiveOffice 365 Groups Deep Dive
Office 365 Groups Deep DiveAndré Vala
 
Content Recommendation with SharePoint Search
Content Recommendation with SharePoint SearchContent Recommendation with SharePoint Search
Content Recommendation with SharePoint SearchAndré Vala
 
Building Solutions with Office Graph
Building Solutions with Office GraphBuilding Solutions with Office Graph
Building Solutions with Office GraphAndré Vala
 
Working with AngularJS
Working with AngularJSWorking with AngularJS
Working with AngularJSAndré Vala
 

More from André Vala (19)

RGPD - Testemunho do Mundo Real
RGPD - Testemunho do Mundo RealRGPD - Testemunho do Mundo Real
RGPD - Testemunho do Mundo Real
 
SharePoint - Presente e Futuro
SharePoint - Presente e FuturoSharePoint - Presente e Futuro
SharePoint - Presente e Futuro
 
Soluções com Office Graph
Soluções com Office GraphSoluções com Office Graph
Soluções com Office Graph
 
Host-Named Site Collections in SharePoint 2013
Host-Named Site Collections in SharePoint 2013Host-Named Site Collections in SharePoint 2013
Host-Named Site Collections in SharePoint 2013
 
User License Enforcement em SharePoint 2013
User License Enforcement em SharePoint 2013User License Enforcement em SharePoint 2013
User License Enforcement em SharePoint 2013
 
How To Use Host-Named Site Collections
How To Use Host-Named Site CollectionsHow To Use Host-Named Site Collections
How To Use Host-Named Site Collections
 
Novidades na pesquisa no SharePoint 2013
Novidades na pesquisa no SharePoint 2013Novidades na pesquisa no SharePoint 2013
Novidades na pesquisa no SharePoint 2013
 
Building Public Web Sites in SharePoint 2010
Building Public Web Sites in SharePoint 2010 Building Public Web Sites in SharePoint 2010
Building Public Web Sites in SharePoint 2010
 
SharePoint + Azure = Better Together
SharePoint + Azure = Better TogetherSharePoint + Azure = Better Together
SharePoint + Azure = Better Together
 
Federated Authentication in SharePoint 2010
Federated Authentication in SharePoint 2010Federated Authentication in SharePoint 2010
Federated Authentication in SharePoint 2010
 
Using BCS to integrate Azure Services with SharePoint 2010
Using BCS to integrate Azure Services with SharePoint 2010Using BCS to integrate Azure Services with SharePoint 2010
Using BCS to integrate Azure Services with SharePoint 2010
 
LINQ to SharePoint
LINQ to SharePointLINQ to SharePoint
LINQ to SharePoint
 
Solução de Negócio baseadas em Office 2010 e SharePoint 2010
Solução de Negócio baseadas em Office 2010 e SharePoint 2010Solução de Negócio baseadas em Office 2010 e SharePoint 2010
Solução de Negócio baseadas em Office 2010 e SharePoint 2010
 
SharePoint Deployment
SharePoint DeploymentSharePoint Deployment
SharePoint Deployment
 
Microsoft Planner Deep Dive
Microsoft Planner Deep DiveMicrosoft Planner Deep Dive
Microsoft Planner Deep Dive
 
Office 365 Groups Deep Dive
Office 365 Groups Deep DiveOffice 365 Groups Deep Dive
Office 365 Groups Deep Dive
 
Content Recommendation with SharePoint Search
Content Recommendation with SharePoint SearchContent Recommendation with SharePoint Search
Content Recommendation with SharePoint Search
 
Building Solutions with Office Graph
Building Solutions with Office GraphBuilding Solutions with Office Graph
Building Solutions with Office Graph
 
Working with AngularJS
Working with AngularJSWorking with AngularJS
Working with AngularJS
 

Recently uploaded

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 

Recently uploaded (20)

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 

From Event Receivers to SharePoint Webhooks (SPS Lisbon 2017)

  • 1. From Event Receivers to SharePoint Webhooks André Vala
  • 3. IT Deputy Director @ Pestana Hotel Group Office Servers and Services MVP SharePoint for 11+ years Speaker & author https://andrevala.com /in/andrevala @atomicvee andre.vala@gmail.com
  • 4. Event Receivers Conclusions 3 SLIDES LEVEL: 100 ALL 7 SLIDES LEVEL: 200 DEV 15 SLIDES + 1 DEMO LEVEL: 300 DEV 15 SLIDES + 1 DEMO LEVEL: 300 DEV 7 SLIDES LEVEL: 100 ALL Remote Event Receivers SharePoint Webhooks Event Handling in SharePoint
  • 5. 1
  • 6. Respond to user actions and modifications to content Add validation logic for columns on list items Cleanup and format content as it is entered by users Calculate and store aggregated values Initialize a host web with new lists during add-in installation
  • 7. 2003 2007 2010 2013 2016 Server-Side Event Receivers Remote Event Receivers SharePoint Webhooks
  • 8. 2
  • 9. Server-side event handling Implemented using an event receiver class Registration requires referencing of the event receiver class Event receivers are deployed by SharePoint solution in a .NET assembly Loaded into SharePoint worker process
  • 10. Executed before data is committed to the Content DB Opportunity for pre-processing like validations Opportunity to cancel the event Run in the same process and thread that triggered the event Block the execution of the current thread UI will be held up Avoid complex time-consuming processing logic
  • 11. Executed after data is committed to the Content DB Cannot be cancelled Opportunity for post-processing like notifications Run on a background thread and do not block the UI This behaviour can be changed by updating the synchronization property of the the event receiver to synchronous
  • 12. Site/Web Events Site Delete   Web Delete   Web Move   Web Add (2010)  Web Provision (2010)    Feature Events Feature Activate  Feature Deactivate  Feature Install  Feature Uninstall  Feature Upgrade  Workflow Events Workflow Start (2010)   Workflow Postpone (2010)  Workflow Complete (2010)  Entity Instance Events Entity Instance Add (2013)  Entity Instance Delete (2013)  Entity Instance Update (2013)  Add-In Lifecycle Events Add-In Install (2013)  Add-In Upgrade (2013)  Add-In Uninstall (2013)  List Events List Add (2010)   List Delete (2010)   Email Reception  List Schema Events Field Add   Field Delete   Field Update   List Item Events Item Add   Item Delete   Item Update   Item Attachment Add   Item Attachment Delete   Item Check In   Item Check Out   Item Uncheck Out   Item File Move   Item File Convert  Item Version Delete (2013)   Security Events (2013) Group Add   Group Update   Group Delete   Group User Add   Group User Delete   Role Definition Add   Role Definition Delete   Role Definition Update   Role Assignment Add   Role Assignment Delete   Role Assignment Update   Break Inheritance   Reset Inheritance  
  • 13. Declaratively for List and Content Type binding Using the object model for all bindings SPWeb new SPSite "http://localhost" SPEventReceiverDefinition "Receiver.Class1" "Receiver, Version=1.0.0.0, Culture=neutral, PublicKeyToken =10b23036c9b36d6d" SPEventReceiverType
  • 14. Inherit from one of the base classes Override the corresponding event methods
  • 15. 3
  • 16. Event handler code runs in remote web (not SharePoint) SharePoint calls web service in remote web to trigger event Must be accessible by anonymous users Supported remote events are a subset of server-side events Remote “before” events implemented as two-way events Remote “after” events implemented as one-way events
  • 17. Modeled as two-way events Execution flow goes to remote web and then back to SharePoint Client is blocked while event processing occurs in remote web Sample execution flow for two-way event 1. Client attempts action which triggers an event (e.g. update item) 2. SharePoint host calls to web service in remote web 3. SharePoint host blocks until call returns from remote web 4. SharePoint host commits action and returns to Client Two Way Event (aka before event) Client SharePoint Host Remote Web 1 2 34
  • 18. Modeled as one-way events Execution flow goes to remote web but does not return Unlike “before” events, after events do not block client response Sample execution flow for one-way event 1. Client attempts action which triggers an event (e.g. update item) 2. SharePoint host commits action and returns to Client 3. SharePoint host executes one-way WCF call on remote web One Way Event (aka after event) Client SharePoint Host Remote Web 1 3 2
  • 19. Site/Web Events Site Delete   Web Delete   Web Move   Web Add  Web Provision    Feature Events Feature Activate Feature Deactivate Feature Install Feature Uninstall Feature Upgrade Workflow Events Workflow Start (2010) Workflow Postpone (2010) Workflow Complete (2010) Entity Instance Events Entity Instance Add   Entity Instance Delete   Entity Instance Update   Add-In Lifecycle Events Add-In Install  Add-In Upgrade  Add-In Uninstall  List Events List Add   List Delete   Email Reception List Schema Events Field Add   Field Delete   Field Update   List Item Events Item Add   Item Delete   Item Update   Item Attachment Add   Item Attachment Delete   Item Check In   Item Check Out   Item Uncheck Out   Item File Move   Item File Convert  Item Version Delete   Security Events Group Add   Group Update   Group Delete   Group User Add   Group User Delete   Role Definition Add   Role Definition Delete   Role Definition Update   Role Assignment Add   Role Assignment Delete   Role Assignment Update   Break Inheritance   Reset Inheritance  
  • 20. Event receivers must be registered with SharePoint host Registration can be declarative with XML for events occurring in app web Registration for events occurring in host web requires writing procedural code
  • 21. Remote event receiver implemented with .svc file Event receiver code written as C# code code-behind .svc file Event receiver is a class that implements IRemoteEventService ProcessEvent method executes when two-way event is triggered ProcessOneWayEvent method executes when one-way event is triggered
  • 22. Passed as parameter Provides you with contextual information about the current event Makes it possible to determine event type and event target object Makes it possible to read user input to perform validation
  • 23. ProcessEvent must return SPRemoteEventResult object Makes it possible to cancel user action when user input is invalid Makes it possible to update user input when processing a “before” event
  • 24.
  • 25.
  • 26. SharePoint add-in model support add-in events Add-in events for installation, upgrade and uninstall Added to add-in project using property sheet Implemented as a remote event receiver App Installed event App Installed event must complete within 30 seconds SharePoint will call the receiver 3 times before failing
  • 27. Declaratively registered in AppManifest.xml
  • 28. Debugging in Office 365 Addresses with http://localhost will not work You must use a Azure Relay to expose your service Visual Studio has native support for debugging via Azure Relay (previously Azure Services Bus)
  • 29.
  • 31. A way to be notified of a done change Push model instead of Pull model Universal model used by many services (WordPress, GitHub, MailChimp, ...) First made available in OneDrive and Outlook Now available in SharePoint Online
  • 32. POST /_api/web/lists('list-id')/subscriptions Application Content-Type: application/json { "resource": "https://contoso.sharepoint.com/_api/web/lists({id})", "notificationUrl": "https://{your host}/your/webhook/service", "expirationDateTime": "2017-06-18T16:17:57+00:00" } SharePoint Service
  • 33. Application Your WebHook notification service endpoint POST https://{your host}/your/webhook/service ?validationToken={randomString} SharePoint Service
  • 34. Application Your WebHook notification service endpoint Content-Type: text/plain {randomString} HTTP/1.1 200 OK SharePoint Service
  • 35. SharePoint Service Application Your WebHook notification service endpoint Content-Type: application/json { "id": "a8e6d5e6-9f7f-497a-b97f-8ffe8f559dc7", "expirationDateTime": "2017-06-18T16:17:57Z", "notificationUrl": "https://{your host}/your/webhook/service", "resource": "{id}" } HTTP/1.1 201 Created Application
  • 38. SharePoint Service Your WebHook notification service endpoint HTTP/1.1 200 OK POST https://{your host}/your/webhook/service Storage Queue WebJob
  • 39. SharePoint Service Your WebHook notification service endpoint Application Storage Queue WebJob SQL Azure DB POST https://{your host}/your/webhook/service POST /_api/web/lists('list-id')/subscriptions Grab “CurrentChangeToken” from list Persist token per subscription Persist last used token per subscription Grab change token from DB
  • 40. Site/Web Events Site Delete Web Delete Web Move Web Add Web Provision   Feature Events Feature Activate Feature Deactivate Feature Install Feature Uninstall Feature Upgrade Workflow Events Workflow Start (2010) Workflow Postpone (2010) Workflow Complete (2010) Entity Instance Events Entity Instance Add Entity Instance Delete Entity Instance Update Add-In Lifecycle Events Add-In Install Add-In Upgrade Add-In Uninstall List Events List Add List Delete Email Reception List Schema Events Field Add Field Delete Field Update List Item Events Item Add  Item Delete  Item Update  Item Attachment Add  Item Attachment Delete  Item Check In  Item Check Out  Item Uncheck Out  Item File Move  Item File Convert  Item Version Delete  Security Events Group Add Group Update Group Delete Group User Add Group User Delete Role Definition Add Role Definition Delete Role Definition Update Role Assignment Add Role Assignment Delete Role Assignment Update Break Inheritance Reset Inheritance
  • 41. WebHooks have a retry mechanism with an incremental back off strategy (5 times with 5 minute interval) WebHook calls are less taxing for your service endpoint The WebHook payload is very small Notifications are batched because processing depends on the CSOM GetChanges() call WebHooks are more secure as no event information is passed along during the notification WebHooks are easier to consume by “non-SharePoint” developers No WCF based endpoints, regular HTTP services are sufficient (e.g. Web API)
  • 42. WebHooks have an expiration date of maximum 6 months after creation You can “renew” a WebHook via a REST call PATCH /_api/web/lists('list-id')/subscriptions('subscriptionID') Two patterns are possible: Have a background job that regularly renews the needed subscriptions (recommended model) Renew at notification time (will drop WebHook if there’s no event within the defined expiration window)
  • 43. Connect remote debugger to your service and web job running in Azure Use ngrok (https://ngrok.com/) as alternative to create a tunnel to your service running on localhost
  • 46. Event Receivers Remote Event Receivers WebHooks SharePoint Server 2003  SharePoint Server 2007  SharePoint Server 2010  SharePoint Server 2013   SharePoint Server 2016   SharePoint Online  
  • 47. Event Receivers Remote Event Receivers WebHooks Site/Web events   List events   List schema events   List item events    Workflow events  Security events   Add-in events   Feature events 
  • 48. Event Receivers Remote Event Receivers WebHooks Easy to develop    Event registration    Event type coverage    Security    Robustness    Compatibility    Future proof    Overall   
  • 49. Remote Event Receivers are here to stay Use Webhooks if Developing exclusively for SharePoint Online (currently) Just need to handle list item events (currently) Want to leverage automatic retries Want to leverage increased security Use Remote Event Receivers if Targeting SharePoint On-Prem (2013 or later) Need to handle events other than list item events Use Server-side Event Receivers if Targeting older versions of SharePoint (before 2013)