The menuCallback method represents a unified response triggered when a user interacts with any type of menu — whether it's an inline menu, a chat-attached (keypad) menu, or a custom component (also known as a workflow-driven menu ). When a user interacts with a cell (such as submitting a form, selecting an option, or pressing a button), this method is sent to the API to reflect the action and pass captured values.
This method returns context about:
values) based on the menuThe callback allows the API to:
| Field | Type | Required | Description |
|---|---|---|---|
method |
String | Yes | "menuCallback" — indicates a unified menu interaction. |
source |
String | Yes | Origin of the interaction: "chat", "inline", or "workflow". |
api_id |
String | Yes | Identifier of the API (bot) that owns the interaction. |
app_id |
String | Yes | Identifier of the app where the menu was displayed. |
from |
User | Yes | User context (includes user id, type). |
chat |
Chat | Conditional | Chat context (includes chat id, type). |
message |
Message | Conditional | Present only if source = "inline" — the message to which the inline menu was attached includes message_id , message reference and gmid |
menu_group |
String | Yes | Menu group ID that the currently interacted cell belongs to. Used to organize related menus under one context or workflow. |
menu_id |
String | Yes | Unique identifier of the specific menu containing the current interacted cell. |
cell_id |
String | Yes | Unique identifier of the current interacted cell. |
callback |
String | Yes | Callback id of the current interacted cell. |
submit |
String | Conditional | Defines the API submission scope when the current interacted cell is triggered |
• cell – sends only the current cell’s value. |
|||
• menu – sends values of all cells in the current menu. |
|||
• all – sends all values filled or triggered across all menus. |
|||
date |
Long | Yes | Unix Epoch timestamp in milliseconds of when the interaction occurred. |
cells |
Array of Cell Interactions | Yes | List of interacted cells with their submitted values |
reference |
String | Optional | Unique identifier for the request. This reference will be echoed in the response. |
Cell Interactions Array (Per Cell Interaction)Each object in cells corresponds to a user interaction with one cell. The structure is the same for inputs, toggles, choices, and button presses.