Add-PnPWebhookSubscription

Adds a new Webhook subscription

Syntax

Add-PnPWebhookSubscription
   -NotificationUrl <String>
                             [-List <ListPipeBind>]
                             [-ExpirationDate <DateTime>]
                             [-ClientState <String>]
                             [-Web <WebPipeBind>]
                             [-Connection <SPOnlineConnection>]

Examples

------------------EXAMPLE 1------------------

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook

Add a Webhook subscription for the specified notification Url on the list MyList

------------------EXAMPLE 2------------------

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01"

Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017

------------------EXAMPLE 3------------------

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01" -ClientState "Hello State!"

Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017 with a specific client state

Parameters

-ClientState

A client state information that will be passed through notifications

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-ExpirationDate

The date at which the Webhook subscription will expire. (Default: 6 months from today)

Type:DateTime
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-List

The list object or name where the Webhook subscription will be added to

Type:ListPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-NotificationUrl

The URL of the Webhook endpoint that will be notified of the change

Type:String
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type:WebPipeBind
Position:Named
Accept pipeline input:False
Accept wildcard characters:False

Outputs

OfficeDevPnP.Core.Entities.WebhookSubscription