• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Telegram Webhook

     
    • 0 Vote(s) - 0 Average

    Telegram Webhook

    Telegram webhook
    CMK
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2023 Jun
    Reputation: 0
    #1
    2023-06-19, 01:16 PM
    Hi there, How am i suppost to do the Webhook for telegram, ive created a bot on Telegram added it to my group also got the token and the Chat ID.

    What do i put in the Webhook url?

    Also heres my template:
    {
      "chat_id": <MY CHAT ID HERE>,
      "photo": "{{ServerUrl}}/Items/{{ItemId}}/Images/Primary",
    {{#if_equals ItemType 'Season'}}
    "caption": "{{{SeriesName}}} {{{Name}}} has been added to {{{ServerName}}}"
    {{else}}
    {{#if_equals ItemType 'Episode'}}
    "caption": "{{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}} has been added to {{{ServerName}}}"
    {{else}}
    "caption": "{{{Name}}} ({{Year}}) has been added to {{{ServerName}}}"
    {{/if_equals}}
    {{/if_equals}}
    }


    Heres my log file as i could not upload it as attachment:
    https://ghostbin.me/649054dee7ed4
    Jellyfin enjoyer.
    crobibero
    Offline

    Core Team (Server & Plugins)

    Posts: 243
    Threads: 0
    Joined: 2023 Jun
    Reputation: 17
    Country:United States
    #2
    2023-06-19, 01:25 PM
    Here is a relevant issue where I go through the Telegram config: https://github.com/jellyfin/jellyfin-plu.../issues/27
    1
    CMK
    Offline

    Junior Member

    Posts: 2
    Threads: 1
    Joined: 2023 Jun
    Reputation: 0
    #3
    2023-06-19, 02:41 PM (This post was last modified: 2023-06-19, 03:00 PM by CMK. Edited 1 time in total.)
    Thanks for the help, So i followed the steps here and now i am getting this error message:
    [2023-06-19 15:59:27.284 +02:00] [WRN] [32] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with response status code BadRequest: "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: there is no photo in the request\"}"

    I added "Jellyfin.Plugin.Webhook": "Debug" to Logging.json
    Still the same error.


    Heres the full error After i added something:
    [2023-06-19 16:50:28.964 +02:00] [WRN] [35] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with "POST" request to https://api.telegram.org/bot<MYBOTTOKEN>/sendPhoto: "{
    \"chat_id\": <myCHATID>,
    \"photo\": \"http://MYJellyfin//Items/bbf23cb2-d9a9-7fd7-d713-966ac347ef3c/Images/Primary\",
    \"caption\": \"The Walking Dead: Dead City Season 1 has been added to CandyMan\"
    }"
    [2023-06-19 16:50:28.966 +02:00] [WRN] [35] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with response status code BadRequest: "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: there is no photo in the request\"}"
    [2023-06-19 16:50:29.207 +02:00] [WRN] [35] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with "POST" request to https://api.telegram.org/bot<MYBOTTOKEN>/sendPhoto: "{
    \"chat_id\": <myCHATID>,
    \"photo\": \"http://MY_JellyFIN//Items/5a3378ff-b293-bd5f-dd97-69ccd90790be/Images/Primary\",
    \"caption\": \"The Walking Dead: Dead City S01E01 Old Acquaintances has been added to CandyMan\"
    }"
    [2023-06-19 16:50:29.208 +02:00] [WRN] [35] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with response status code BadRequest: "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: there is no photo in the request\"}"
    [2023-06-19 16:50:29.408 +02:00] [WRN] [35] Jellyfin.Plugin.Webhook.Destinations.Generic.GenericClient: Notification failed with "POST" request to https://api.telegram.org/bot<MYBOTTOKEN>/sendPhoto: "{
    \"chat_id\": <myCHATID>,
    \"photo\": \"http://MYJELLYFIN//Items/4f9622ff-a80e-b07a-13c0-cb226d9c950e/Images/Primary\",
    \"caption\": \"The Walking Dead: Dead City (2023) has been added to CandyMan\"
    Jellyfin enjoyer.
    Fallenbagel
    Offline

    Community Moderator

    Posts: 20
    Threads: 0
    Joined: 2023 Jun
    Reputation: 0
    Country:Maldives
    #4
    2023-06-19, 10:24 PM (This post was last modified: 2023-06-19, 10:42 PM by Fallenbagel. Edited 2 times in total.)
    Quote:\"photo\": \"http://MYJELLYFIN//Items/4f9622ff-a80e-b07a-13c0-cb226d9c950e/Images/Primary\",
    The photo link I believe has to have ssl and be reachable by telegram, I.e https, external domain.

    For example,
    Code:
    https://jellyfin.domain.com/Items/4f9622ff-a80e-b07a-13c0-cb226d9c950e/Images/Primary

    Also the, {{ServerUrl}} uses the server url stated on the first field of that webhook config page and make sure there's no trailing slash on that. 

    Or you could just hardcode your url to this block,
    Code:
    "photo": "https://jellyfin.domain.com/Items/{{ItemId}}/Images/Primary"
    AshipaEkO
    Offline

    Junior Member

    Posts: 9
    Threads: 0
    Joined: 2023 Jun
    Reputation: 0
    #5
    2023-06-20, 12:37 PM
    (2023-06-19, 10:24 PM)Fallenbagel Wrote:
    Quote:\"photo\": \"http://MYJELLYFIN//Items/4f9622ff-a80e-b07a-13c0-cb226d9c950e/Images/Primary\",
    The photo link I believe has to have ssl and be reachable by telegram, I.e https, external domain.

    For example,
    Code:
    https://jellyfin.domain.com/Items/4f9622ff-a80e-b07a-13c0-cb226d9c950e/Images/Primary

    Also the, {{ServerUrl}} uses the server url stated on the first field of that webhook config page and make sure there's no trailing slash on that. 

    Or you could just hardcode your url to this block,
    Code:
    "photo": "https://jellyfin.domain.com/Items/{{ItemId}}/Images/Primary"

    Allow me to butt in, i have a similar error message

    Code:
    [2023-06-20 12:20:58.115 +00:00] [INF] Executing "Webhook Item Added Notifier"
    [2023-06-20 12:20:58.389 +00:00] [WRN] Notification failed with "POST" request to https://api.telegram.org/bot5459248626:AAFANuVCT4t_XRbc3AwA1GGdWCPRgaF4LwE/sendPhoto: "{
      \"chat_id\": XXXXXXXXXX,
      \"photo\": \"https://my.website/Items/7cd7cb21-2303-8c27-5301-2135723c36f9/Images/Primary\",
    \"caption\": \"Coyote (2023) has been added to jf-two\"
    }"
    [2023-06-20 12:20:58.391 +00:00] [WRN] Notification failed with response status code BadRequest: "{\"ok\":false,\"error_code\":400,\"description\":\"Bad Request: there is no photo in the request\"}"
    [2023-06-20 12:20:58.397 +00:00] [INF] "Webhook Item Added Notifier" Completed after 0 minute(s) and 0 seconds
    [2023-06-20 12:20:58.400 +00:00] [INF] ExecuteQueuedTasks


    In my case the URL works just fine and opens to the exact picture. It is also https.



    is the issue with   https://api.telegram.org/bot{mytoken}/sendPhoto?

    i'm 99% sure the token is correct. the bot works.

    when i try the url in a browser i get:

    Code:
    {"ok":false,"error_code":400,"description":"Bad Request: there is no photo in the request"}
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode