Webhook

Post Reply
bweaver
Newbie
Posts: 2
Joined: Fri Oct 17, 2014 7:20 pm

Webhook

Post by bweaver »

Hello,

I've been trying to get Webhook to work and have had no luck. I have my URL and my firewall configured. When I browse using Chrome to: https://webhook.mydomain.com:51081/ I get {"status":true}. To me that means the port and URL are configured properly. When I configure my web portal to send Webhooks to https://webhook.mydomain.com:51081/ I get a failure every time. Can anyone offer any suggestions on what could be wrong or what I've missed?

Kind regards,
B. Weaver
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Webhook

Post by jan_suhr »

In the setup of your Webhook you have in the property one item called "Path". It is in a way an unclear name since it really is the unique identifier of your Webhook and that identifier must be part of the URL as a "path"

So if you set the path value to "path/mywebhook" your URL is "https://webhook.mydomain.com:51081/path/mywebhook"

Good luck
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
bweaver
Newbie
Posts: 2
Joined: Fri Oct 17, 2014 7:20 pm

Re: Webhook

Post by bweaver »

Thanks for the reply!

I have tested the path and still receive a failure from my order portal.

Settings in Switch:
Image

Settings for the webhook URL in my order portal:
Image

If I am receiving the {"status":true} message when browsing to my base url I can assume my firewall, SSL, and url are correct right?
freddyp
Advanced member
Posts: 1009
Joined: Thu Feb 09, 2012 3:53 pm

Re: Webhook

Post by freddyp »

Describe the failure in the order system. It is not necessarily a network setup problem.

Just browsing to the URL also does not say everything because that uses a GET. Submitting web hooks is usually done through POST. In order to test the network setup in a reliable way, my advice is to use a tool like Postman and post a couple of parameters. It is vital to do this on the computer of the order system so you are sure you have the exact same situation.

If that works, then it is probably a handshake problem. The default behavior of Switch when receiving a web hook is to acknowledge this by sending { status: true } back to the sender of the web hook. Some systems that send web hooks expect a specific answer and yet other systems send web hooks in two steps: they send something to which they expect a certain response and when the response is correct, they then send the payload. Perhaps your order system behaves like that and although two-way communication has taken place, there is an error because your order system does not like the response.
Post Reply