I have an application that takes in SharePoint webhook notifications. Currently, the format of the site URLs is: /sites/<hub-site>/<sub-site>. Each of these sub sites has 3 libraries. I have added a webhook subscription using PnP PowerShell to each of these libraries.
The problem I am facing is the resulting siteUrl field in the webhook notification is not the right URL, only supplying: /sites/<hub-site> without the subsite portion of the URL. This ends up as an exception because no libraries exist on that path.
I use the command Add-PnPWebhookSubscription -List <list> -NotificationUrl <url> -ClientState <list-id> to add my webhooks.
Has anyone faced this issue before?
{ "value": [ { "subscriptionId": "<subscription-id>", "clientState": "<list-id>", "expirationDateTime": "2025-12-12T16:13:07.5160000Z", "resource": "<list-id>", "tenantId": "<tenant-id>", "siteUrl": "/sites/<hub-site-name>", // no sub site "webId": "<web-id>" } ] } Update: Solved! I was able to use the webId field to find the individual subsite within the supplied hub site URL.