Trying to get a Webhook out to Synology Chat directly from Node Red. Is this possible?

So I’m trying to follow this guide: https://www.synology.com/en-us/knowledgebase/DSM/tutorial/Collaboration/How_to_configure_webhooks_and_slash_commands_in_Chat_Integration#t2.1

Specifically where it says the following:

Place this JSON string after the payload parameter, and use application/x-www-form-urlencoded to send data to the webhook URL. For example:

POST https://DS_IP/webapi/entry.cgi?api=SYNO.Chat.External&XXXXX Content-Type: application/x-www-form-urlencoded payload=%7B%22text%22%3A%22This%20is%20a%20test.%22%7D

Now I’ve tried to use the synology_chat module in HA but it simply doesn’t work. Gives me a bunch of errors. I figure maybe I can just send the webhook directly from Node Red. I have no idea how to do it though. Any help would be appreciated!

You can use the “http request” node. Has basic fields url and auth, but using a msg input you can pass parameters, headers, etc.

What is the error you get? I’ve just configured this and have it working.

I’m getting this error when doing a curl command on the NAS itself through SSH:

curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to mysynodomain.com:443

And when I try the POST it using JSON through Node-Red, I get the same type of SSL handshake errors.

Could you share the commands you are using (whether it’s curl or JSON POST) that work for you? I’m really not sure what is going wrong on my end. My DDNS works just fine, Chat works fine as well, just cannot get the webhooks to work.

@reckless I’m just using my incoming webhooks for Notifier but the thing I thought that was critical (based on the Synology Chat configuration) is that your Hass instance must be able to reach your NAS on the external address for this to work. You may also require a certificate which is of course easy enough.

https://example.your.synology.com/webapi/entry.cgi?api=SYNO.Chat.External

If your Hass instance is inside your LAN with your NAS, then it might not be able to ‘see’ this address if your router doesn’t support hairpinning/NAT loopback.

I was using a Syno router which I loved but it didn’t support this feature and it drove me crazy. Since changed my whole network over to @UBNT and external addresses are now accessible from inside my LAN which makes everything so much easier.

Forgive me if I’m teaching you to suck eggs but it’s just a thought.

EDIT. If you are in fact trying to use the internal IP, then it’s probably related to a certificate error?

My router is also by Ubiquiti actually and does support Nat loopback by default. My hass instance is reverse proxied so it’s not running on ssl internally, only from the outside. This works great for me otherwise, no other issues other than this Synology Chat issue. I am also sending out the webhook to the ddns, rather than the local ip. Although I wish there was a way to just send it locally (won’t have to go out to the WAN that way).

As for certificate, I have one cert for hass reverse proxy and one for Synology, both seperate of course as they are on different URLs. Do you have the same?

Out of curiosity, how are you using it within Node Red? Which node and what syntax?

I’m not using Node Red. I’m just wanting notify.hass_synochat to be able to send messages to the Chat app on my phone as I was sending a snapshot from a camera using Pushbullet and then I sent too many images and now need a subscription. So I’ve ditched Pushbullet and have taken another look at Syno Chat.

I’ve got it sending text messages but struggling with attachments at the mo as json is a very big weakness of mine.

I’m using Postman to test and have managed to send the following to my external NAS URL which has a letsencrypt certificate:

payload={"text": "my first webhook via rest"}

I tested the internal IP with and without https and both fail.

I want to test the chat from synology and after setup having this error when i try to trigger the service.
SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)’)))

Is there any solution?

Done it.Must to ad

verify_ssl: False