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).

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 

Name 

Type 

Description 

Name 

Type 

Description 

chat_id 

string 

Identifier of the chat 

dst_num 

string 

Number of the message recipient 

extension_id 

integer 

Identifier of the extension number 

flow 

string 

Direction of the message (outin

id 

string 

Identifier of the message 

init_time_gmt 

string 

Time the message was received or sent 

read 

boolean 

true if the message was read, otherwise the value is false 

src_num 

string 

Number of the message sender 

status 

string 

Status of the message 

text 

string 

Text of the message 

Message Events 

The message events are configured similarly to other extension number events (message-in, message-out).  

Event message-in 

Name 

Type 

Description 

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 

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 

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 

GET /extension/{extension_id}/message/ 

Get the extension number messages 

URL Options 

Name 

Type 

Name 

Type 

extension_id 

string 

Request Options 

Name 

Type 

Name 

Type 

start_datetime 

string 

src_num 

string 

dst_num 

string 

end_datetime 

string 

per_page 

integer 

page 

integer 

order 

string 

Response Options 

Name 

Type 

Name 

Type 

chat_id 

string 

dst_num 

string 

extension_id 

integer 

flow 

string 

id 

string 

init_time_gmt 

string 

read 

boolean 

src_num 

string 

status 

string 

text 

string 

POST /extension/{extension_id}/message/send/ 

Send the message 

URL Options 

Name 

Type 

Name 

Type 

extension_id 

string 

Request Options 

Name 

Type 

Name 

Type 

dst_num 

string 

src_num 

string 

text 

string 

Response Options 

Name 

Type 

Name 

Type 

chat_id 

string 

id 

string 

status 

string 

GET /extension/{extension_id}/message/{message_id} 

Get (read) the message 

URL Options 

Name 

Type 

Name 

Type 

extension_id 

string 

message_id 

string 

Response Options 

Name 

Type 

Name 

Type 

chat_id 

string 

dst_num 

string 

extension_id 

long 

flow 

string 

id 

string 

init_time_gmt 

string 

read 

boolean 

src_num 

string 

status 

string 

text 

string 

PUT /extension/{extension_id}/message/{message_id} 

Mark the message as been read 

URL Options 

Name 

Type 

Name 

Type 

extension_id 

string 

message_id 

string 

Request Options 

Name 

Type 

Name 

Type 

read 

boolean 

Response Options 

Name 

Type 

Name 

Type 

chat_id 

string 

dst_num 

string 

extension_id 

long 

flow 

string 

id 

string 

init_time_gmt 

string 

read 

boolean 

src_num 

string 

status 

string 

text 

string 

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/ 

Description of Data Structures 

"Extension Number” Section Resources