Hello everyone,
I am facing a persistent technical issue in n8n and need some expert guidance. I tried searching everywhere for a working solution or a direct support channel, but community forum posting is the proper way, so I am sharing my complete setup and troubleshooting steps here.
My Objective:
I am trying to trigger and send an animated GIF (loading indicator) to a Telegram chat using an n8n workflow.
What I Have Done & Tried:
HTTP Request Node Setup: I configured an HTTP Request node to call the Telegram Bot API directly.
API Endpoint & Methods: I tested using the sendAnimation method endpoint (https://api.telegram.org/bot<MY_TOKEN>/sendAnimation).
Parameters Passed:
Bot Token: 1858692658:AAOumvIWQubZBW4UJLCnBAKxUchA9oOHNA4
Chat ID: 856862658
File ID: AAMCBAADGQEDrWMvaumV5aK5cOTW4VtjPu_dy-BXgTIAAgseAAKaz1FTqupGoa_fxJIBAAdtAAM9BA
The Problem:
Every single time I execute the node, it consistently fails with a 401 Unauthorized error (Authorization failed - please check your credentials), even though the Bot Token and Chat ID are completely correct and verified.
Could someone please point out what might be wrong with my URL formatting, authentication header placement, or body parameters in the n8n HTTP Request node when calling Telegram’s sendAnimation?
Thank you so much for your help!
Hi @abd2001
Your bot token is visible in this post. Revoke it through @BotFather, generate a replacement for the same bot, update n8n, and remove the exposed token from the post.
First test the replacement in an HTTP Request node:
- Method: GET
- URL:
https://api.telegram.org/bot<NEW_TOKEN>/getMe - Authentication: None
- Send Headers: off
- Send Body: off
Replace <NEW_TOKEN> completely, including the brackets, while keeping the bot prefix. Telegram authenticates through that URL; getMe needs no chat or file parameters.
After it returns ok: true, use POST with https://api.telegram.org/bot<NEW_TOKEN>/sendAnimation. Enable Send Body, select Body Content Type JSON, and pass chat_id and animation. The animation value must be an animation file_id belonging to the same bot.
If getMe still returns 401, share its response body with secrets removed.
A 401 Unauthorized error on the Telegram Bot API usually indicates that whitespace was accidentally introduced into the bot token string within the URL path or that an authorization header is conflicting with the path token. Double-check that your expression evaluating the bot token trims any leading or trailing spaces. Let me know how your HTTP Request node parameters and headers are currently structured and I can outline the exact payload mapping right here.