Webhook not being received in Switch

Post Reply
matthew.hearne
Member
Posts: 24
Joined: Thu Dec 19, 2019 3:00 pm

Webhook not being received in Switch

Post by matthew.hearne »

We have a flow where I am submitting some very basic information to a webhook.

This was setup and working on an instance on Switch perfectly fine.

We have since then migrated to a new Instance of Switch and when we went to setup this flow, the webhook element is not working.

I have tested it using Postman and I can post the data into the old instance no problem.

However, in the new instance, we don't get anything arriving on Switch. We get a response shown of success when we post though.

Not sure what we need to check / change to get this to work.

Any help or suggestions are appreciated.
mkayyyy
Member
Posts: 75
Joined: Mon Nov 21, 2016 6:31 pm
Location: UK

Re: Webhook not being received in Switch

Post by mkayyyy »

Which port and path are you sending your requests to? If you were using the now legacy version of the webhook element in your previous Switch instance and have set up brand new Switch instance then I'm guessing the latest Webhook default app has been installed.

If that's the case you could either roll back the Webhook default app in your Enfocus ID to v6 or keep it as is and update the URL you're sending requests to.

Legacy webhooks had a default port and path like this: https://switchserver:51080/notify
The new Node.js webhooks have a default port and path like this: https://switchserver:51088/scripting/notify
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Webhook not being received in Switch

Post by JimmyHartington »

I hope it is okay I use this post for another Webhook question.
I am just trying to get the hang of webhooks and will make a test locally on the server.
But I can not get the webhook to receive any data. Maybe I have misinterpreted how it should work.

I have setup a webhook configurator. Set the path to "/scripting/test".
Then I use Postman to try and send data to this webhook directly on the server.
But get an error with "Subscription cannot be found".

Image
mkayyyy
Member
Posts: 75
Joined: Mon Nov 21, 2016 6:31 pm
Location: UK

Re: Webhook not being received in Switch

Post by mkayyyy »

JimmyHartington wrote: Wed Jun 07, 2023 10:54 am I hope it is okay I use this post for another Webhook question.
I am just trying to get the hang of webhooks and will make a test locally on the server.
But I can not get the webhook to receive any data. Maybe I have misinterpreted how it should work.

I have setup a webhook configurator. Set the path to "/scripting/test".
Then I use Postman to try and send data to this webhook directly on the server.
But get an error with "Subscription cannot be found".

Image
Your webhook request type is a POST request so you'll need to send a POST request from Postman instead of a GET request
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Webhook not being received in Switch

Post by JimmyHartington »

With Postman set to "Post" I get the same error.
Does Webhooks requiring a special license from Enfocus?
mkayyyy
Member
Posts: 75
Joined: Mon Nov 21, 2016 6:31 pm
Location: UK

Re: Webhook not being received in Switch

Post by mkayyyy »

Ah you'll also need to change the Path flow element property on the Webhook element just to be "/test" rather than "/scripting/test"
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Webhook not being received in Switch

Post by JimmyHartington »

Then I get another error.
Image

I am probably missing something very simple.
User avatar
magnussandstrom
Advanced member
Posts: 345
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Webhook not being received in Switch

Post by magnussandstrom »

Hi Jimmy, in postman you set the path to ../scripting/test but in switch you set the path to only test.
User avatar
JimmyHartington
Advanced member
Posts: 278
Joined: Tue Mar 22, 2011 7:38 am

Re: Webhook not being received in Switch

Post by JimmyHartington »

Thanks, Magnus.
I had it the other way around.

Now Postman seems to accept the setup.
But the configurator throws an error.

Image

UPDATE: In Postman I need to define JSON in the body as Raw. And then it works in my test.

THANKS for all the help to guide me down the right path.
Post Reply