Skip to content

Instantly share code, notes, and snippets.

@ypcode
Last active September 16, 2017 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/35e3f06d428a8791c29c3873ca5942f2 to your computer and use it in GitHub Desktop.
Save ypcode/35e3f06d428a8791c29c3873ca5942f2 to your computer and use it in GitHub Desktop.
Connect-PnPOnline https://yourtenant.sharepoint.com/sites/yoursite
# "testwebhook" is the name of our target list
Add-PnPWebhookSubscription -List testwebhook -NotificationUrl https://your-functions.azurewebsites.net/api/sample-webhook
# The command above outputs the following
# Id : 080e41c2-3c30-4c4d-8d1c-fa22249aedc0
# ClientState :
# ExpirationDateTime : 12-Mar-18 22:00:00
# NotificationUrl : https://your-functions.azurewebsites.net/api/sample-webhook
# Resource : 6efa3b51-f514-4b88-9117-3d158e3f8fe2
# We can also remove the subscription with the following Cmdlet
Remove-PnPWebhookSubscription -List testwebhook -Identity 080e41c2-3c30-4c4d-8d1c-fa22249aedc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment