Your bot must be connected and authenticated over the WebSocket session to receive incoming messages. The Bot Server does not store any messages for bots for later retrieval.
Incoming Messages
Your bot must be connected and authenticated over the WebSocket session to receive incoming messages. The Bot Server does not store any messages for bots for later retrieval.
The following table lists the different incoming JSON messages for the bot.
Message Details
Incoming messages represent new incoming, edited or deleted message details from server
Field | Description | Type | Required |
---|---|---|---|
method | "message" | String | Yes |
message | Object represents the content of the message | Message | Yes |
{
"method": "message",
"message": {
"date": 1600168078602,
"reference": 2097,
"chat": {
"name": "Amir Salah",
"id": "90089668723575679",
"terminal": "Mobile",
"type": "Contact",
"version": "('0HNt','1QBk','2c2H','31RN')"
},
"sent_to": {
"id": "90091903321704167"
},
"message_id": "i1_CD11KwDr126551",
"style": 0,
"from": {
"name": "Amir Salah",
"id": "90089668723575679",
"terminal": "Mobile",
"type": "Contact",
"version": "('0HNt','1QBk','2c2H','31RN')"
},
"text": "Hello",
"type": "text"
}
}
User Details
Incoming message represent new or updated user or bot profile. This inbound message returned as a reply to GetUser .
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "userDetails" |
user | User | Yes | Object represents a nandbox user or bot account |
{
"method": "userDetails",
"user": {
"image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABsSFBcUERsXFhceHBsgKEIrKCUlKFE6PTBCYFVlZF9V\nXVtqeJmBanGQc1tdhbWGkJ6jq62rZ4C8ybqmx5moq6T/2wBDARweHigjKE4rK06kbl1upKSkpKSk\npKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKT/wAARCABeAF4DASIA\nAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAgQBAwUABv/EACwQAAIBAwMDAwQCAwEAAAAAAAEC\nAAMEERIhMQVBURNhcQYUIjKBkSMzY9H/xAAYAQEBAQEBAAAAAAAAAAAAAAAAAQIDBP/EABwRAQEB\nAQEBAQEBAAAAAAAAAAABEQIhEgMiQf/aAAwDAQACEQMRAD8A0xCAkA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8zt+fvlcP2knsbOs+0BjvE6NwVw\npGRGC3tHXHy5y6//2Q==\n",
"name": "Amir Salah",
"photo": {
"thumbnail": {
"width": 120,
"id": "V_0HNt_90089668723575679_0_Q0CrJoK5iB.jpg.thumb.jpg",
"height": 120
},
"width": 256,
"id": "V_0HNt_90089668723575679_0_Q0CrJoK5iB.jpg",
"height": 256
},
"id": "90089668723575679",
"is_bot": false,
"version": "0HNt"
}
}
Chat Details
Incoming message represent new or updated Group or Channel profile This inbound message returned as a reply to GetChat
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "chatDetails" |
chat | Chat | Yes | This object represents a nandbox group or channel information |
{
"method": "chatDetails",
"chat": {
"cancel": 0,
"regions": null,
"owner_id": "90089668723575679",
"admin": 1,
"description": "",
"welcome_message": null,
"title": "Test",
"type": "Channel",
"slotMax": 0,
"inivite_link": "https://join.ndbx.me/join?id=SzzFPuoDUdTiF4k2iXyJFFSB4XLIcBUjVXYbfuuJfos%3D&type=Channel&pay=0",
"language_code": null,
"allDay": 0,
"splash_config": null,
"isPublic": 0,
"startTime": 1590979113000,
"id": "90090691357982716",
"member_count": 2,
"vapp": 0,
"slotSpace": 0,
"area": null,
"classification": null,
"version": "hybonm",
"slotDuration": 0,
"createdDate": 1599767443000,
"parent_id": "1",
"tagsDefinition": null,
"endTime": 1590979113000,
"category": "S",
"fees_range": null,
"splash": 0
}
}
Chat Menu Callback
Incoming message represents information about a clicked button associated with a normal keypad menu.
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "chatMenuCallback" |
chatMenuCallback | ChatMenuCallback | Yes | object represents an incoming callback query from a callback button associated with a normal keypad menu |
{
"method": "chatMenuCallback",
"chatMenuCallback": {
"date": 1600588639278,
"button_callback": "VCB0",
"next_menu": null,
"button_query_result": null,
"chat": {
"id": "90089668723575679",
"type": "Mobile"
},
"from": {
"id": "90089668723575679",
"type": "Mobile"
},
"menu_ref": "ThirdMenu",
"button_label": "Alfateha"
}
}
Inline Message Callback
Incoming message represents information about a clicked button within an inline keypad menu associated with a specific message
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "inlineMessageCallback" |
inlineMessageCallback | inlineMessageCallback | Yes | object represents an incoming callback query from a callback button within an inline keypad menu associated with a specific message |
{
"method": "inlineMessageCallback",
"inlineMessageCallback": {
"date": 1601556230820,
"reference": "91551042165645",
"button_callback": "oneBtnCBInWebView",
"next_menu": null,
"button_query_result": null,
"chat": {
"id": "90089668723575679",
"type": "Mobile"
},
"from": {
"id": "90089668723575679",
"type": "Mobile"
},
"message_id": "p1_o87RlPgT38178",
"menu_ref": "MAIN_MENU_001",
"button_label": ""
}
}
Chat Member
Incoming message represents information about group or channel member returned as a reply to getChatMember , banChatMember, unbanChatMember, removeChatMember and when user join or leaves the chat.
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "chatMember" |
chatMember | ChatMember | Yes | object represents a chat member user. |
{
"chatMember": {
"member_since": 1590979113000,
"privileges": ["1", "4611686018427387904"],
"view": 0,
"account_type": "msisdn",
"chat": {
"id": "90090691357982716"
},
"type": "Admin",
"user": {
"id": "90089668723575679"
},
"status": "Active",
"tags": null
},
"method": "chatMember"
}
Chat Administrators
Incoming message represents information about group or channel administrators returned as a reply to getChatAdministrators.
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "chatAdministrators" |
chatAdministrators | ChatAdministrators | Yes | object represents channel or group administrator users. |
{
"chatAdministrators": {
"chat": {
"id": "90090691357982716"
},
"administrators": [{
"id": "90089668723575679"
}, {
"id": "90091905646805157"
}
]
},
"method": "chatAdministrators"
}
My Profile
Incoming message represents Bot profile details , this will be come as a reply to getMyProfiles outgoing message
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "myProfile" |
user | User | Yes | User object represents Bot profile details |
{
"method": "myProfile",
"user": {
"name": "Bot Title",
"photo": {
"thumbnail": {
"width": 120,
"id": "7e8bc6cddff924.jpg.thumb.jpg",
"height": 120
},
"width": 256,
"id": "7e8bc6cddff92487fbeb4074e.jpg",
"height": 256
},
"id": "4521191845180798",
"version": "0btm",
"status": "Bot Status"
}
}
Message Ack
Incoming message represents outbound message acknowledge.
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "myProfilemessageAck" |
ack | Ack | Yes | Object represents outbound messages acknowledgment details. |
{
"method": "messageAck",
"ack": {
"reference": 15459134560801,
"date": 1545913595858,
"message_id": "p1_Ua0ZWAyX13260293"
}
}
Workflow Details
Incoming messages represent the workflow cell properties. It is a response when submit button is pressed.
Field | Type | Required | Description |
---|---|---|---|
method | String | Yes | "WorkflowCell" |
workflowCell | Array of Workflow Cell | Yes | Object represents the workflow cells properities |