Skip to content

spo list webhook add

Adds a new webhook to the specified list

Usage

spo list webhook add [options]

Options

Option Description
--help output usage information
-u, --webUrl <webUrl> URL of the site where the list to add the webhook to is located
-l, --listId [listId] ID of the list to which the webhook which should be added. Specify either listId or listTitle but not both
-t, --listTitle [listTitle] Title of the list to which the webhook which should be added. Specify either listId or listTitle but not both
-n, --notificationUrl <notificationUrl> The notification url
-e, --expirationDateTime [expirationDateTime] The expiration date. Will be set to max (6 months from today) if not provided
-c, --clientState [clientState] A client state information that will be passed through notifications
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Important

Before using this command, log in to a SharePoint Online site, using the spo login command.

Remarks

To add a webhook, you have to first log in to a SharePoint Online site using the spo login command, eg. spo login https://contoso.sharepoint.com.

Examples

Add a web hook to the list Documents located in site https://contoso.sharepoint.com/sites/ninja with the notification url https://contoso-funcions.azurewebsites.net/webhook and the default expiration date

spo list webhook add --webUrl https://contoso.sharepoint.com/sites/ninja --listTitle Documents --notificationUrl https://contoso-funcions.azurewebsites.net/webhook

Add a web hook to the list Documents located in site https://contoso.sharepoint.com/sites/ninja with the notification url https://contoso-funcions.azurewebsites.net/webhook and an expiration date of January 21st, 2019

spo list webhook add --webUrl https://contoso.sharepoint.com/sites/ninja --listTitle Documents --notificationUrl https://contoso-funcions.azurewebsites.net/webhook --expirationDateTime 2019-01-21

Add a web hook to the list Documents located in site https://contoso.sharepoint.com/sites/ninja with the notification url https://contoso-funcions.azurewebsites.net/webhook, a very specific expiration date of 6:15 PM on March 2nd, 2019 and a client state

spo list webhook add --webUrl https://contoso.sharepoint.com/sites/ninja --listTitle Documents --notificationUrl https://contoso-funcions.azurewebsites.net/webhook --expirationDateTime '2019-03-02T18:15' --clientState "Hello State!"