Skip to content
Documentation menu
Concepts

Ad context

Telegram examples. Choose your platform →

Pass context from the actual Telegram update. Field names use snake_case in HTTP and Python, and camelCase in Node.js.

Required context

Ad requests require a numeric user_id, platform_id and a non-empty language_code. /ad also requires message, the bot reply. Read the selected endpoint or SDK reference for the complete field list.

Language

Use the Telegram language_code when present and an explicit fallback when it is missing. An omitted SDK language can reach the HTTP API as an empty value and cause a rejected request.

Optional context

first_name accepts up to 128 characters; user_message accepts up to 4096. user_message is the user’s input, while message is the bot’s response. Match parse_mode to the mode used when sending the message.

Group chats

The HTTP API accepts group_id and participants_count. SDK 0.8.0 does not serialize these group fields. Use HTTP for group scenarios, including ephemeral rich messages, and follow the rich delivery guide.