Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You can test API methods in the API online browser page and without writing any code
Some resources described in the page may not be available by default due to the application type (see Application Creation and Authorization)

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 

 Expand

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 

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 

 GET /extension/{extension_id}/message/

GET /extension/{extension_id}/message/ 

Get the extension number messages 

URL Options 

Name 

Type 

extension_id 

string 

Request Options 

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 

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/

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

Send the message 

URL Options 

Name 

Type 

extension_id 

string 

Request Options 

Name 

Type 

dst_num 

string 

src_num 

string 

text 

string 

Response Options 

Name 

Type 

chat_id 

string 

id 

string 

status 

string 

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

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

Get (read) the message 

URL Options 

Name 

Type 

extension_id 

string 

message_id 

string 

Response Options 

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}

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

Mark the message as been read 

URL Options 

Name 

Type 

extension_id 

string 

message_id 

string 

Request Options 

Name 

Type 

read 

boolean 

Response Options 

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 

 DELETE /extension/{extension_id}/message/{message_id}

DELETE /extension/{extension_id}/message/{message_id} 

Delete the message 

URL Options 

Name 

Type 

extension_id 

string 

message_id 

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 

 Expand

Name 

Type 

Description 

count_new 

long 

Counter of unread messages 

id 

string 

Identifier of the chat 

last_message_id 

string 

Identifier of the last message 

last_message_init_time_gmt

string 

Time the last message was received or sent 

last_message_text 

string 

Text of the last message 

remote_number 

string 

Number of the chat companion 

"Extension Number” Section Resources 

 GET /extension/{extension_id}/chat/

GET /extension/{extension_id}/chat/ 

Get the chat list 

URL Options 

Name 

Type 

extension_id 

string 

Request Options 

Name 

Type 

remote_number 

string 

per_page 

integer 

page 

integer 

order 

string 

Response Options 

Name 

Type 

count_new 

long 

id 

string 

last_message_id 

string 

last_message_init_time_gmt 

string 

last_message_text 

string 

remote_number 

string 

 GET  /extension/{extension_id}/chat/{chat_id}

GET  /extension/{extension_id}/chat/{chat_id} 

Get information about the recent chat messages 

URL Options 

Name 

Type 

extension_id 

string 

chat_id 

string 

Response Options 

Name 

Type 

count_new 

long 

id 

string 

last_message_id 

string 

last_message_init_time_gmt 

string 

last_message_text 

string 

remote_number 

string 

 DELETE /extension/{extension_id}/chat/{chat_id}

DELETE /extension/{extension_id}/chat/{chat_id} 

Delete the chat 

URL Options 

Name 

Type 

extension_id 

string 

chat_id 

string 

 GET /extension/{extension_id}/chat/{chat_id}/messages/

GET /extension/{extension_id}/chat/{chat_id}/messages/ 

Get the chat message list 

URL Options 

Name 

Type 

extension_id 

string 

chat_id 

string 

Request Options 

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 

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}/chat/{chat_id}/messages/

PUT /extension/{extension_id}/chat/{chat_id}/messages/ 

Set the chat messages as "read" 

URL Options 

Name 

Type 

extension_id 

string 

chat_id 

string 

Request Options 

Name 

Type 

read 

boolean 

Response Options 

Name 

Type 

id 

string 

read 

boolean 

 DELETE /extension/{extension_id}/chat/{chat_id}/messages/

DELETE /extension/{extension_id}/chat/{chat_id}/messages/ 

Delete the chat messages 

URL Options 

Name 

Type 

extension_id 

string 

chat_id 

string 

  • No labels