Basic methods and how to use them

Other topics

SendMessage method

https://api.telegram.org/bot*BOTTOKEN*/sendmessage?chat_id=exampleID&text=exampleText&parse_mode=HTML

What does this do? With your parameters adjusted correctly this call will send a message to the exampleID user with the exampleText as message with an HTML encoding. Standard encoding is markdown (see source) but in some cases you may use HTML.

Next to the chat_id, text and parse_mode you can use the following parameters:

  • disable_web_page_preview - For disabling the standard preview if you send a link
  • disable_notification - For disabling the notification on userside (Android users will still get a notification, but without sound)
  • reply_to_message_id - Sends the message as a reply to another message (with this ID)
  • reply_markup - Send your custom keyboard with this parameter

Only the chat_id and the text parameter are required to send a simple message, all other operators are optional. The disable_web_page_preview and the disable_notification method will need a boolean operator (true or false) to work. All of the parameters are case sensitive so watch out!

For more information jump to the sendMessage part of the bot api doku.

Contributors

Topic Id: 10007

Example Ids: 30734

This site is not affiliated with any of the contributors.