Getting 'Failed to validate notificationUrl' error message while registering webhook with SharePoint

Microsoft

Hi,

I am trying to register webhook with SP Online. I have developed the Webhook with Azure Function and have further created a public URL using ngrok, a public proxy with an incoming tunnel that will redirect requests from a public URL to our internal localhost. While registering the webhook with the SPO using Power Automate workflow, I am receiving 400 status code with 'Failed to validate notification URL' error. My webhook registration looks like this:

HTTP POST:

https://<tenant-name>.sharepoint.com/sites/<site-relative-url>/_api/web/lists('ea668f84-c994-4662-a3fc-16f39f2c950d')/subscriptions

 

[ea668f84-c994-4662-a3fc-16f39f2c950d - ID of the target Library]

 

HEADERS:

Accept: application/json; odata=verbose

Content-Type: application/json

 

BODY:

{
"resource": "https://<tenant-name>.sharepoint.com/sites/<site-relative-url>/_api/web/lists('ea668f84-c994-4662-a3fc-16f39f2c950d')",
"notificationUrl": "https://64f0-2409-40e0-104e-f7ab-f1aa-f05-d5a9-5f11.ngrok-free.app/api/ProcessEvent",
"expirationDateTime": "2024-05-30T22:30:00+00:00"
}

 

The authentication part looks like below:

PGAzDev01_0-1716371524629.png

 

Any advice on how to resolve this? We are totally block here and cannot progress further.

 

Quick Note: I did the validation token test using the ngrok service url in Power Automate and I could be able to get the validationtoken data in the response with 200 status code as below:

PGAzDev01_1-1716371672249.png

 

0 Replies