Ninko 78 Posted July 16, 2020 Posted July 16, 2020 Hi, Is it possible to use webhooks with Synology Chat? Thanks
Ninko 78 Posted July 20, 2020 Author Posted July 20, 2020 I was weighing up different options to get server notifications, for example playback started etc.
Luke 42079 Posted July 29, 2020 Posted July 29, 2020 Well you can definitely send webhooks out on these events. I'm not familiar with Synology Chat enough to know how to receive using that though. @FrostByte have you used that?
Smiehu 6 Posted October 29, 2023 Posted October 29, 2023 I also try to send notification by webhooks to Synology Chat but nothing works. Here is example: https://kb.synology.com/en-us/DSM/tutorial/How_to_configure_webhooks_and_slash_commands_in_Chat_Integration
Luke 42079 Posted October 30, 2023 Posted October 30, 2023 15 hours ago, Smiehu said: I also try to send notification by webhooks to Synology Chat but nothing works. Here is example: https://kb.synology.com/en-us/DSM/tutorial/How_to_configure_webhooks_and_slash_commands_in_Chat_Integration Hi, what exactly did you configure, and how? What exactly happened? How to Report a Problem Thanks.
Smiehu 6 Posted October 30, 2023 Posted October 30, 2023 5 hours ago, Luke said: Hi, what exactly did you configure, and how? What exactly happened? How to Report a Problem Thanks. I create a channel in Synology Chat and add Integration-Incoming webhooks and link to this channel. I got a link with token: http://my_nas_ip:20000/webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token="my_token" I add Notification (webhook) in Emby and choose application/json. Test was sent (Emby no error) but nothing come to Synology Chat. Link is OK because I have second channel to home assistant and it works ok.
Luke 42079 Posted October 30, 2023 Posted October 30, 2023 24 minutes ago, Smiehu said: I create a channel in Synology Chat and add Integration-Incoming webhooks and link to this channel. I got a link with token: http://my_nas_ip:20000/webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token="my_token" I add Notification (webhook) in Emby and choose application/json. Test was sent (Emby no error) but nothing come to Synology Chat. Link is OK because I have second channel to home assistant and it works ok. OK well, what are the differences between the two requests? Synology Chat is obviously expecting something that Emby Server isn't sending, so what is that? If you can find that out, then we can always add more options to configure the webhook so that you can make it work.
Smiehu 6 Posted October 30, 2023 Posted October 30, 2023 2 minutes ago, Luke said: OK well, what are the differences between the two requests? Synology Chat is obviously expecting something that Emby Server isn't sending, so what is that? If you can find that out, then we can always add more options to configure the webhook so that you can make it work. Thanks. In this link I believe is some more info about this webhooks: https://kb.synology.com/en-us/DSM/tutorial/How_to_configure_webhooks_and_slash_commands_in_Chat_Integration 1. To create a message like the one shown above, build a JSON payload, indicated as follows: {"text": "This is a test"} 2. Place the 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 3. Below is an example for CURL: curl -X POST \ --data-urlencode 'payload={"text": "This is a test"}' \ https://DS_IP/webapi/entry.cgi?api=SYNO.Chat.External&XXXXX
Luke 42079 Posted November 3, 2023 Posted November 3, 2023 On 10/30/2023 at 4:06 AM, Smiehu said: Thanks. In this link I believe is some more info about this webhooks: https://kb.synology.com/en-us/DSM/tutorial/How_to_configure_webhooks_and_slash_commands_in_Chat_Integration 1. To create a message like the one shown above, build a JSON payload, indicated as follows: {"text": "This is a test"} 2. Place the 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 3. Below is an example for CURL: curl -X POST \ --data-urlencode 'payload={"text": "This is a test"}' \ https://DS_IP/webapi/entry.cgi?api=SYNO.Chat.External&XXXXX It works with home assistant because they've added special support for synology chat: https://www.home-assistant.io/integrations/synology_chat/ So they have their own generic webhooks, and then on top of that, they have formatters for different services to format the output in the way that the service expects. We don't have that, and that really was the reason for having a generic webhooks feature to begin with, meaning you can use something like IFFFT to receive it, parse it, and then send some instruction to something else (synology chat). So what has to happen is either one of the following. Either we have to start adding special support for different outputs, or you have to setup something in between to receive the webhook and act on it accordingly.
Smiehu 6 Posted November 3, 2023 Posted November 3, 2023 2 hours ago, Luke said: It works with home assistant because they've added special support for synology chat: https://www.home-assistant.io/integrations/synology_chat/ So they have their own generic webhooks, and then on top of that, they have formatters for different services to format the output in the way that the service expects. We don't have that, and that really was the reason for having a generic webhooks feature to begin with, meaning you can use something like IFFFT to receive it, parse it, and then send some instruction to something else (synology chat). So what has to happen is either one of the following. Either we have to start adding special support for different outputs, or you have to setup something in between to receive the webhook and act on it accordingly. I understand. Thanks for answer and Your time. I hope in future release this will be fix one way or another:) 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now