Jellyfin Forum
Help - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Help (/t-help--976)



Help - Aaditya Joshi - 2023-09-11

I am new to Jellyfin and want to set up Slack notifications using webhooks to get notifications when a user has started playing ANY content. However, I am getting the following error in the logs (I have redacted sensitive info):
Code:
[05:53:31] [WRN] [41] Jellyfin.Plugin.Webhook.Destinations.Slack.SlackClient: Notification failed with POST request to https://hooks.slack.com/services/<webhookidandmore>: { "token": "", "user": "", "device": "", "title": "", "url": "https://<servername.com>/web/index.html#!/details?id=<ig-goes-here>&serverId=<serveridgoeshere>", "url_title": "", "priority": , "sound": "", "message": "JohnDoe started watching Looney.Tunes.Cartoons.S05E04 ()" } [05:53:31] [WRN] [41] Jellyfin.Plugin.Webhook.Destinations.Slack.SlackClient: Notification failed with response status code BadRequest: invalid_payload
I am using this template for my webhook setup which I found on a similar post on this Subreddit.
Code:
{
  "token": "{{Token}}",
  "user": "{{UserToken}}",
  "device": "{{Device}}",
  "title": "{{{Title}}}",
  "url": "{{ServerUrl}}/web/index.html#!/details?id={{ItemId}}&serverId={{ServerId}}",
  "url_title": "{{{MessageUrlTitle}}}",
  "priority": {{MessagePriority}},
  "sound": "{{NotificationSound}}",
  {{#if_equals NotificationType 'ItemAdded'}}
    {{#if_equals ItemType 'Season'}}
      "message": "{{{SeriesName}}} {{{Name}}} has been added to {{{ServerName}}}"
    {{else}}
      {{#if_equals ItemType 'Episode'}}
        "message": "{{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}} has been added to {{{ServerName}}}"
      {{else}}
        "message": "{{{Name}}} ({{Year}}) has been added to {{{ServerName}}}"
      {{/if_equals}}
    {{/if_equals}}
  {{/if_equals}}
  {{#if_equals NotificationType 'PlaybackStart'}}
    {{#if_equals ItemType 'Season'}}
      "message": "{{{NotificationUsername}}} started watching {{{SeriesName}}} {{{Name}}}"
    {{else}}
      {{#if_equals ItemType 'Episode'}}
        "message": "{{{NotificationUsername}}} started watching {{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}}"
      {{else}}
        "message": "{{{NotificationUsername}}} started watching {{{Name}}} ({{Year}})"
      {{/if_equals}}
    {{/if_equals}}
  {{/if_equals}}
  {{#if_equals NotificationType 'PlaybackStop'}}
    {{#if_equals ItemType 'Season'}}
      "message": "{{{NotificationUsername}}} stopped watching {{{SeriesName}}} {{{Name}}}"
    {{else}}
      {{#if_equals ItemType 'Episode'}}
        "message": "{{{NotificationUsername}}} stopped watching {{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}}"
      {{else}}
        "message": "{{{NotificationUsername}}} stopped watching {{{Name}}} ({{Year}})"
      {{/if_equals}}
    {{/if_equals}}
  {{/if_equals}}
}

I am sure that I'm doing something wrong but not sure what. Any help will be appreciated.