Messages (/message/) and Chats (/chat/)
You can test API methods on the interactive API browser page and without writing code
Some of the resources described on the page may not be available by default due to the type of application (see Creating and authorizing applications).
This page describes the resources of messages and chats as well as specifies the options of message events (/event/).
Messages
It is the resource to manage extension number messages. Using the resource /message/, you can:
Send message: POST /extension/{extension_id}/message/send/
Get messages (statistics): GET /extension/{extension_id}/message/, or the specific message by its ID — GET /extension/{extension_id}/message/{message_id}
Mark message (is read or not): PUT /extension/{extension_id}/message/{message_id}
Delete message: DELETE /extension/{extension_id}/message/{message_id}
Description of Data Structures
Message Events
The message events are configured similarly to other extension number events (message-in, message-out).
Event message-in
Name | Type | Description |
---|---|---|
extension_name | string | Name of the called extension number (in the form xxx*yyy@domain) |
did_number | string | Public number of the callee that is configured to receive messages |
src_number | string | Number of the message sender |
extension_id | integer | Identifier of the extension number |
text | string | Text of the message |
Event message-out
Name | Type | Description |
---|---|---|
extension_name | string | Name of the called extension number (in the form xxx*yyy@domain) |
src_number | string | Public number of the subscriber (DID) that is configured to receive messages |
extension_id | int | Identifier of the extension number |
dst_number | string | Number of the message recipient |
text | string | Text of the message |
The message message-out-status is similar to the message message-out, except for
Name | Type | Description |
---|---|---|
extension_name | string | Name of the called extension number (in the form xxx*yyy) |
status | string | Message sending status, may be either sent or failed |
Messages and SIP MESSAGE
When there is an incoming message (message-in) to the equipment of extension numbers of type 'phone', SIP MESSAGE is duplicated, and it may be read in the device if the device of extension number type 'phone' supports SIP MESSAGE.
Outgoing messages SIP MESSAGE from equipment of the 'phone' type extension numbers are supported.
The SIP MESSAGE exchange within the PBX does not appear in the chats.
"Extension Number” Section Resources
Chats
Using the resource /chat/, you can:
Get list of chats: GET /extension/{extension_id}/chat/
Get information about the recent chat messages: GET /extension/{extension_id}/chat/{chat_id}
Delete chat: DELETE /extension/{extension_id}/chat/{chat_id}
Get list of chat messages: GET /extension/{extension_id}/chat/{chat_id}/messages/
Mark chat messages as read: PUT /extension/{extension_id}/chat/{chat_id}/messages/
Delete all chat messages: DELETE /extension/{extension_id}/chat/{chat_id}/messages/