Skip to main content

Telegram Message Types

There are various types of message content that can be sent to your users:

Text

Telegram Text Message
Telegram Text Message
{
type: "TEXT",
text: "Hello World!",
}
PropertyDescriptionRequired
typeTEXTY
textStringY

Image

Telegram Image
Telegram Image
{
type: "IMAGE",
url: "http://image.png",
text: "Some title",
}
PropertyDescriptionRequired
typeIMAGEY
urlURL of the image fileY
textStringN
note
  • Image must be a valid image file format, including .jpg, .jpeg and .png
  • Maximum file size is 25MB

Audio

Telegram Audio
Telegram Audio
{
type: "AUDIO",
url: "http://audio.mp3",
}
PropertyDescriptionRequired
typeAUDIOY
urlURL of the audio fileY
note
  • Audio must be a valid audio file format, including .aac, .flac, .m4a, .m4p, .mp3, .wav, .wma
  • Maximum file size is 25MB

Video

Telegram Video
Telegram Video
{
type: "VIDEO",
url: "http://video.mp4",
text: "Some title",
}
PropertyDescriptionRequired
typeVIDEOY
urlURL of the video fileY
textStringN
note
  • Video must be a valid video file format, including .mkv, .gif, .avi, .wmv, .rmvb, .mp4, .m4v, .mpg, .mpeg, .3gp
  • Maximum file size is 25MB

File

Telegram File
Telegram File
{
type: "FILE",
url: "http://file.pdf",
}
PropertyDescriptionRequired
typeFILEY
urlURL of the file attachmentY
note
  • File must be a valid file format, including .pdf
  • Maximum file size is 25MB

Animation

Animation is image file in GIF.

Telegram Animation
Telegram Animation
{
type: "ANIMATION",
url: "https://img.gif",
text: "Some title",
attachmentId: "SomeStringID"
}
PropertyDescriptionRequired
typeANIMATIONY
urlURL of the image fileY
textStringN
attachmentIdString; ID of your uploaded imageN
note
  • Image must be a valid image file format, including .gif
  • Maximum file size is 25MB

Button

Telegram Button
Telegram Button
{
type: "Any Message Type",
url: "https://img.png",
text: "What can I do to help?",
buttons: [{
type: "postback",
title: "some title",
payload: "a long payload here"
}],
}
Response Object
PropertyDescriptionRequired
typeAny message type specified aboveY
urlURL of the message content if message type is IMAGE, AUDIO, VIDEO, FILE or ANIMATIONN
textString; applicable only if message type is TEXTN
buttonsArray of buttons; only "postback" can be set as button typeY
buttons Object
PropertyDescriptionRequired
typepostbackY
titleStringY
payloadCustom defined payload triggersY

Keyboards

Telegram Keyboards
Telegram Keyboards
{
type: "Any Message Type",
url: "https://img.png",
text: "What can I do to help?",
keyboards: [
[
{ text: "Keyboard 1" },
{ text: "Keyboard 2" },
{ text: "Keyboard 3" }
]
]
}
Response Object| Property | Description | Required | --- | --- | --- | type | Any message type specified above | Y | url | URL of the message content if message type is IMAGE, AUDIO, VIDEO, FILE or ANIMATION | N | text | String; applicable only if message type is TEXT | N | keyboards | Array of keyboard buttons; only set keywords as triggers | Ykeyboards Object| Property | Description | Required | --- | --- | --- | text | String; title of keyboard buttons | Y