DEV

Telegram

Telegram Connection

Put Telegram to Work with @Human Automations and @Human Agents

The Telegram Connection documents all Triggers, Actions and Query Operations available for creating automations via the Telegram API.

What can you do with the Telegram Connection?

  • Connect to the Telegram API in a few clicks

  • Use the related Telegram Operations (see below) in @Human Automations or @Human Agents

Trigger Operations

New Message

Triggers on: messages/new_message

Triggered when a new message is received in a Telegram chat.

Action Operations

Action: Send Message

Action: Send Poll

Action: Send Photo

Query Operations

Example link

Example link

Obtaining Access Credentials

To obtain a Personal Access Token (PAT) for Telegram Bot API, follow these steps:

Steps:

  1. Log in to Telegram

    • Use an account with admin privileges (if managing a bot for an organization).

  2. Create a Bot (if not already done)

    • Open a chat with @BotFather.

    • Send /newbot and follow prompts to name and generate a bot.

    • Copy the Bot Token (this is your PAT).

  3. Access the Token

    • The token is immediately provided by @BotFather after creation.

    • Store it securely (e.g., environment variables, secrets manager).

Configuring Webhooks

  1. Obtain the Bot Token: Acquire the unique API token for your bot from @BotFather as described in the access credentials section.

  2. Configure a Secure Endpoint: Prepare a public HTTPS-enabled URL on your server to receive JSON-formatted update payloads from Telegram.

  3. Register the Webhook: Send a POST or GET request to the Telegram Bot API using the setWebhook method: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/setWebhook?url=<YOUR_PUBLIC_HTTPS_URL>.

  4. Validate the Setup: Confirm the registration was successful by checking the API response for an "ok": true status and a success message.

  5. Inspect Webhook Information: Submit a request to the getWebhookInfo endpoint (https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getWebhookInfo) to review the current configuration and troubleshoot any delivery issues.

Code (Apache v2.0): Service Connectivity and Metadata

Code (Apache v2.0): List of External Resources and Internal Mapping

Last updated