Send media by url or id
Telegram Bot API's send-media-by-url-or-id tool enables seamless sending of various media types like documents, photos, videos, and audio directly to Telegram chats using file IDs or HTTP URLs. It simplifies media delivery in Telegram bots while supporting extensive customization options.
Features
- Supports sending multiple media types: Document, Photo, Audio, Video, Video Note, Voice, and Sticker.
- Allows sending media via HTTP URL or existing Telegram file ID for flexibility.
- Supports adding captions to media for contextual information.
- Includes options to send messages silently without notifications or with notifications.
- Enables advanced interaction with reply_markup for inline keyboards, custom keyboards, and force replies.
Benefits
- Streamlines media sharing within Telegram bots for enhanced user engagement.
- Reduces development complexity by handling file transfers with simple parameters.
- Provides flexibility in targeting chats by accepting chat IDs or usernames.
- Improves user experience with options like silent messages and interactive keyboards.
- Boosts communication capabilities with support for diverse media formats and message customization.
Description
Sends a file (document, photo, video, audio, ...) by HTTP URL or by ID that exists on the Telegram servers. See the docs for more information
Parameters
7 parameters
| Name | Type | Description |
|---|---|---|
| chatIdrequired | string | Enter the unique identifier for the target chat (e.g. |
| caption | string | Enter the caption. |
| mediaTyperequired | enum | Select the media type. |
| mediarequired | string | Pass a file_id to send a file that exists on the Telegram servers or pass an HTTP URL for Telegram to get a file from the Internet. File must meet Telegram's requirements for MIME type and size. |
| disable_notification | boolean | Choose if to send the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound. |
| reply_to_message_id | string | Enter the ID of the original message. |
| reply_markup | string | Enter additional interface options that are a JSON-serialized object including an inline keyboard, a custom reply keyboard, instructions to remove the reply keyboard or instructions to force a reply from the user, e.g. |