← All platforms

Messaging

Telegram

target_app: "telegram" · endpoint /v1/messaging/execute · Bring your own credentials

Setup

Message @BotFather on Telegram, run /newbot, and copy the token it gives you (looks like 123456:ABC-DEF...). Paste it into your Connections page under Telegram.

Credentials needed on your Connections page

bot_tokenBot Token. Find it: @BotFather → /newbot

Actions

send_text

Send a plain text message.

Request body:

{
  "user_id": "...",
  "action": "send_text",
  "payload": { "text": "Hello!" },
  "target_app": "telegram"
}

provider_response.result shape:

{ "message_id": 42, "from": {...}, "chat": {...}, "text": "Hello!" }

send_media

Send a photo with an optional caption.

Request body:

{
  "user_id": "...",
  "action": "send_media",
  "payload": { "imageUrl": "https://.../photo.jpg", "caption": "Nice shot" },
  "target_app": "telegram"
}

provider_response.result shape:

{ "message_id": 43, "photo": [...] }

send_document

Send a file/document with an optional caption.

Request body:

{
  "user_id": "...",
  "action": "send_document",
  "payload": { "documentUrl": "https://.../file.pdf", "caption": "Here you go" },
  "target_app": "telegram"
}

provider_response.result shape:

{ "message_id": 44, "document": {...} }

edit_message

Edit a previously sent message's text.

Request body:

{
  "user_id": "...",
  "action": "edit_message",
  "payload": { "messageId": 42, "text": "Updated text" },
  "target_app": "telegram"
}

provider_response.result shape:

{ "message_id": 42, "text": "Updated text" }

get_history

Fetch recent updates (Telegram getUpdates).

Request body:

{
  "user_id": "...",
  "action": "get_history",
  "payload": { "limit": 10 },
  "target_app": "telegram"
}

provider_response.result shape:

{ "result": [ {...update...} ] }

delete_message

Delete a message.

Request body:

{
  "user_id": "...",
  "action": "delete_message",
  "payload": { "messageId": 42 },
  "target_app": "telegram"
}

provider_response.result shape:

{ "ok": true }

Anticipated errors & fixes

"chat not found"

Cause: The user_id (chat ID) is wrong, or the user has never started a conversation with your bot.

Fix: The recipient must message your bot first (Telegram requires this before a bot can message them) — user_id must be their numeric Telegram chat ID.

"bot was blocked by the user"

Cause: The recipient blocked your bot.

Fix: Nothing to fix on your end — the user needs to unblock the bot themselves.

401 Unauthorized from Telegram itself (inside provider_response)

Cause: Bot token is wrong or was regenerated via @BotFather.

Fix: Get a fresh token from @BotFather and update it on your Connections page.

401 "Unauthorized: Invalid API key."

Cause: Your eConnect Authorization header is missing, malformed, or the key was regenerated/revoked.

Fix: Copy your api_key fresh from the eConnect dashboard and confirm the header reads exactly "Authorization: Bearer <key>".

429 "Too many requests"

Cause: You've exceeded your plan's per-minute rate limit.

Fix: Wait a minute and retry, or upgrade your plan for a higher per-minute limit.

429 "Monthly API limit exceeded"

Cause: You've used your plan's full monthly request allowance.

Fix: Wait for your next billing cycle reset, or upgrade to a plan with a higher monthly limit.

← Back to all platforms