optns https://w1.nandbox.net/message
Message
The main message method defines all parameters for all incoming messages to the bot.
Field | Type | Required | Description |
---|---|---|---|
message_id | String | Yes | Unique identifier for this message. |
reference | Long | Yes | Unique local identifier |
chat | Chat | Yes | Conversation the message belongs to. |
from | User | Yes | Sender User of this message |
sent_to | User | Yes | Receiver user, most of the case it is the bot ID except if channel has multiple administrators, it will be the specific admin who should receive the message. |
type | String | Yes | "text": For text messages "text_file": Message is a text tile. Any message exceeds 1800 characters will be converted to text file. "photo":Message is a photo."gif": Message is a GIF"sticker": Message is a sticker."video": Message is a video"audio": Message is an audio"voice": Message is a voice note "location": Message is a location"contact": Message is a contact "document": Message is a document |
date | Long | Yes | Date the message was sent in Unix Epoch timestamp in milliseconds. |
reply_to_message_id | String | Optional | Parent message Unique identifier. |
from_admin | Integer | Optional | 1 if from user is admin, otherwise it is 0 |
text | String | Conditional | Only available when type is text |
text_file | Text_File | Conditional | Only available when type is text_file |
photo | Photo | Conditional | Only available when type is photo |
gif | GIF | Conditional | Only available when type is gif |
sticker | Sticker | Conditional | Only available when type is sticker |
video | Video | Conditional | Only available when type is video |
audio | Audio | Conditional | Only available when type is audio |
voice | Voice | Conditional | Only available when type is voice |
document | Document | Conditional | Only available when type is document |
location | Location | Conditional | Only available when type is location |
contact | Contact | Conditional | Only available when type is contact |
status | String | Optional | "deleted" if messages is recalled and "updated" if it is updated. |
chat_settings | Integer | Optional | 1 if from chat settings bot, otherwise it is 0 |
caption | String | ||
bg_color | String | ||
article | Article | ||
url | String | ||
white_list_user | WhiteListUser | ||
tag | TagDefinition | ||
schedule_date | Long | Optional | Long time format like this example 1579102262 |
Text_File
This object represents a text file.
Field | Type | Required | Description |
---|---|---|---|
Id | String | Yes | Unique identifier for this file |
size | Integer | Yes | File size. |
Menu
Each Menu consists of a set of rows. At least one row should be defined.
Field | Type | Required | Description |
---|---|---|---|
menu_ref | String | Yes | Unique identifier of this Menu as defined by bot. |
rows | Array of Row | Yes | Rows belong to this menu. Row which is an Array of buttons |
Row
Each row belongs to one keypad menu that composes of set of buttons. At least one button should be defined.
Field | Type | Required | Description |
---|---|---|---|
buttons | Array of Button | Yes | Button belongs to the row. |
row_order | Integer | Yes | Row order in the menu. |
Button
This object represents the button for replying. The button must have a button_callback which is the unique identifier defined by bot.
Field | Type | Required | Description |
---|---|---|---|
button_callback | String | Yes | This is unique identifier as defined by bot. The button_callback returned in inlineMessageCallback and ChatMenuCallback when button pressed. |
next_menu | Menu | Optional | Menu unique identifier that reference the next menu to navigate to it when the button pressed. |
button_span | Integer | Optional | Button Span |
button_order | Integer | Optional | The number of button order by ascending |
button_text_color | String | Optional | Text color of the button Title The color should be in hexadecimal format (Hex triplet ) or according to its common English name. Example : Red color can be set as "RED" or "#FF0000" |
button_bg_color | String | Optional | Button background color. The color should be in hexadecimal format (Hex triplet ) or according to its common English name. Example : Red color can be set as "RED" or "#FF0000" |
button_label | String | Optional | Button label or title. |
button_url | String | Optional | Button URL. When button pressed, an external URL link will be opened. |
button_query | String | Optional | Field used to query information from app, this can take one of two values as follows Location: to ask user to get location or point of map information. Contact : to ask user to get his contact number. |
chat | Chat | Optional | Chat is a unique identifier that references the specific channel or group to be opened when button is pressed. The user should be a member of the specified channel or group. If button_url and chat are both defined, both will be executed. |
nav_type | String | Optional | -Null is default to show navigation button for channel, group or contact-Type "admin" for show admin navigation button in chat setting. |
ButtonQueryResult
This object represents an incoming button query results from a callback button
Field | Type | Required | Description |
---|---|---|---|
latitude | String | Optional | Only sent in case of buttonQuery is location |
longitude | String | Optional | Only sent in case of buttonQuery is location |
contact | String | Option | Only sent in case of buttonQuery is phone_number. |