Messages

The Messages API provides functionality for receiving and processing user messages.


Basic information

Base URI

Scopes

  • messages_read
  • messages_write

Endpoints

RESOURCE_URI — URI is obtained from token exchange point.

Prefix Endpoint Description
RESOURCE_URI messages/ Receiving conversation messages
RESOURCE_URI messages/chats/ Getting a list of conversations
RESOURCE_URI messages/add/ Adding a message
RESOURCE_URI messages/ID Retrieving message details
RESOURCE_URI messages/ID/edit/ Editing a message
RESOURCE_URI messages/ID/delete/ Deleting a message

+Getting a list of conversations

Endpoint

Scopes

  • messages_read

Request

  • No specific request params

Response


+Receiving conversation messages

Endpoint

Scopes

  • messages_read

Request

Response


+Retrieving message details

Endpoint

Scopes

  • messages_read

Request

  • No specific request params

Response


+Adding a message

Endpoint

Scopes

  • messages_write

Request

Response


+Editing a message

Endpoint

Scopes

  • messages_write

Request

Response


+Deleting a message

Endpoint

Scopes

  • messages_write

Request

  • No specific request params

Response

  • No specific responce params

Definitions

MessagesChatsResponse

Name Description

items[]
object

@MessagesChatsItemResponse

MessagesChatsItemResponse

Name Description

chat_id
unsigned integer

Chat ID.
For a private conversation the chat ID coincides with the user ID.

type
string

Possible values:

  • private
  • group

name
string

Chat name.
For the group type only.

picture_url
string

Chat picture URL.
For the group type only.

members_count
string

Number of members in the group chat.
For the group type only.

MessagesListRequest

Name Description

chat_id (r)
unsigned integer

Chat ID.
For a private conversation the chat ID coincides with the user ID.

limit (o)
unsigned integer

Number of items expected in response.

cursor (o)
string

The value of the next_cursor / prev_cursor parameter from the responce.
Should be empty to get the first set (page) of elements.

query (o)
string

Query string for the search filter.

period (o)
string

@MessagesPeriodFilter
Period of dates for the date filter.

MessagesListResponse

Name Description

items[]
object

@MessagesItemResponse

limit
unsigned integer

Number of returned items (items per page).

next_cursor
string

URL for the next portion of items (next page).
Empty if there is no items for the next portion.

prev_cursor
string

URL for the previous portion of items (previous page).
Empty if there is no items for the previous portion.

total_count
unsigned integer

Total number of items.

MessagesItemResponse

Name Description

id
unsigned integer

Message ID.

uid
unsigned integer

ID of the user who sent the message.

message
string

Message text.

attachments
object

AttachmentStructure

MessagesPeriodFilter

Name Description

from
string

Start date.
Format: ISO 8601.

till
string

Finish date.
Format: ISO 8601.

MessagesAddRequest

Name Description

chat_id (r)
unsigned integer

Chat ID.
For a private conversation the chat ID coincides with the user ID.

message
string

Message text.

attachments[]
object

AttachmentsConfiguration

is_whisper
boolean

If true the message will be considered as a whisper.

MessagesAddRequest

Name Description

chat_id (r)
unsigned integer

Chat ID.
For a private conversation the chat ID coincides with the user ID.

message
string

Message text.

attachments[]
object

AttachmentsConfiguration