Has anyone been successful in configuring a Webhook in Switch? I can't even get the HTTP to work, I will eventually need the HTTPS. I've never generated a Certificate, Private Key or password before?
I've setup my HTTP webhook, using Postman to send the requests... just getting a 404 error in return.
Any suggestions?
Webhook for HTTPS
-
- Member
- Posts: 37
- Joined: Thu May 18, 2017 12:06 am
Webhook for HTTPS
Last edited by actionHero on Mon Nov 26, 2018 8:48 pm, edited 2 times in total.
Re: Webhook for HTTPS
404 means Switch doesn't know which page to serve. Have you already setup a Webhook element in one of your flows and is the flow activated?
Do you get errors in the Switch messages?
Do you get errors in the Switch messages?
-
- Member
- Posts: 37
- Joined: Thu May 18, 2017 12:06 am
Re: Webhook for HTTPS
Hello,
No errors in Switch Messages.
Yes I have the webhook setup in a flow.
I'm using 'test/notify' as the URL.
My put call form Postman is http://"myIP":8080/test/notify
I get a 404 return...
If I just enter, http://"myIP":8080
I get the messages from Enfocus PDF Review Module. So I at least know it's connecting. It's just not seeing the "test/notify" in my webhook URL.
No errors in Switch Messages.
Yes I have the webhook setup in a flow.
I'm using 'test/notify' as the URL.
My put call form Postman is http://"myIP":8080/test/notify
I get a 404 return...
If I just enter, http://"myIP":8080
I get the messages from Enfocus PDF Review Module. So I at least know it's connecting. It's just not seeing the "test/notify" in my webhook URL.
-
- Member
- Posts: 37
- Joined: Thu May 18, 2017 12:06 am
Re: Webhook for HTTPS
Hello,
No errors in Switch Messages.
Yes I have the webhook setup in a flow.
I'm using 'test/notify' as the URL.
My put call form Postman is http://"myIP":8080/test/notify
I get a 404 return...
If I just enter, http://"myIP":8080
I get the messages from Enfocus PDF Review Module. So I at least know it's connecting. It's just not seeing the "test/notify" in my webhook URL.
No errors in Switch Messages.
Yes I have the webhook setup in a flow.
I'm using 'test/notify' as the URL.
My put call form Postman is http://"myIP":8080/test/notify
I get a 404 return...
If I just enter, http://"myIP":8080
I get the messages from Enfocus PDF Review Module. So I at least know it's connecting. It's just not seeing the "test/notify" in my webhook URL.
Re: Webhook for HTTPS
Are you using the WebhookRequest class in your script?
Here is an example form the manual.
Here is an example form the manual.
Code: Select all
function webhookTriggered( s : Switch, r : WebhookRequest )
{
if (r == null)
{
try
{
s.webhookSubscribe(WebhookRequest.POST, "/myscript/notify");
}
catch(e)
{
s.log(3, "Error: %1", String( e ));
}
return;
}
s.log(1,"Received request using method: %1", r.method);
s.log(1,"Request data: %1", r.getBody().toString());
s.log(1,"Request headers: %1", JSON.stringify(r.headers));
s.log(1,"Request query: %1", JSON.stringify(r.query));
if ('my_header' in r.headers)
{
s.log(1,"Value of 'my_header': %1", r.headers.my_header);
}
if ('my_parameter' in r.query)
{
s.log(1,"Value of 'my_parameter': %1", r.query.my_parameter);
}
}
-
- Member
- Posts: 37
- Joined: Thu May 18, 2017 12:06 am
Re: Webhook for HTTPS
Hi Jan,
I was just hoping to use the webhook configurator built in to Switch. Are you saying it doesn't work?
Thanks
I was just hoping to use the webhook configurator built in to Switch. Are you saying it doesn't work?
Thanks
Re: Webhook for HTTPS
You posted in Scripting...actionHero wrote: ↑Mon Nov 26, 2018 6:14 pm Hi Jan,
I was just hoping to use the webhook configurator built in to Switch. Are you saying it doesn't work?
Thanks
Re: Webhook for HTTPS
Does that mean that both Switch and the PDF review module server are running on the same system and setup to listen to the same port?actionHero wrote: ↑Mon Nov 26, 2018 5:41 pm Hello,
No errors in Switch Messages.
Yes I have the webhook setup in a flow.
I'm using 'test/notify' as the URL.
My put call form Postman is http://"myIP":8080/test/notify
I get a 404 return...
If I just enter, http://"myIP":8080
I get the messages from Enfocus PDF Review Module. So I at least know it's connecting. It's just not seeing the "test/notify" in my webhook URL.
If you are running them on the same server, then I would suggest to use different ports.
-
- Member
- Posts: 37
- Joined: Thu May 18, 2017 12:06 am
Re: Webhook for HTTPS
I did end up changing the ports and its working now. Simple fix.