Jump to content

Recommended Posts

Posted

Hi,

Is it possible to use webhooks with Synology Chat?

Thanks

Posted

Hi, what exactly do you want to do?

Posted

I was weighing up different options to get server notifications, for example playback started etc.

  • 2 weeks later...
Posted

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?

  • 3 years later...
Posted
5 hours ago, Luke said:

Hi, what exactly did you configure, and how? What exactly happened?

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.

Posted
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.

Posted
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

 

Posted
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.

Posted
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:)

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...