---
url: /apidocs/textchat.md
---
## Textchat API

Textchat API is deprecated. Use [Channel API](channel.md) instead .

| Endpoint | Method | Description |
|-----|-----|-----|
| ~~[textchat:getTextchatForRoom](#get-textchat-for-room)~~ | websocket | Get textchat for room |
| ~~[textchat:getTextchatForProp](#get-textchat-for-prop)~~ | websocket | Get textchat for prop |
| ~~[textchat:getTextchatForVideochat](#get-textchat-for-videochat)~~ | websocket | Get textchat for videochat |
| ~~[textchat:getTextchatForUser](#get-textchat-for-user-direct-textchat-)~~ | websocket | Get textchat for user (direct textchat) |
| ~~[textchat:getLastMessage](#get-last-textchat-message)~~ | websocket | Get last textchat message |
| ~~[textchat:listMessages](#list-textchat-messages)~~ | websocket | List textchat messages |
| ~~[textchat:markTextchatAsRead](#mark-textchat-as-read)~~ | websocket | Mark textchat as read |
| ~~[textchat:listTextchats](#list-textchats)~~ | websocket | List textchats |
| ~~[textchat:listRoomTextchats](#list-room-textchats)~~ | websocket | List room textchats |
| ~~[textchat:listDirectTextchats](#list-direct-textchats)~~ | websocket | List direct textchats |
| ~~[textchat:searchTextchats](#search-textchats)~~ | websocket | Search textchats |
| ~~[textchat:searchDirectTextchats](#search-direct-textchats)~~ | websocket | Search direct textchats |
| ~~[textchat:getDirectCounter](#get-unread-direct-textchat-counter)~~ | websocket | Get unread direct textchat counter |
| ~~[textchat:sendMessage](#send-textchat-message)~~ | websocket | Send textchat message |
| ~~[textchat:sendNewMessage](#send-new-textchat-message)~~ | websocket | Send new textchat message |
| ~~[textchat:editMessage](#edit-textchat-message)~~ | websocket | Edit textchat message |
| ~~[textchat:blockMessage](#block-textchat-message)~~ | websocket | Block textchat message |
| ~~[textchat:unblockMessage](#unblock-textchat-message)~~ | websocket | Unblock textchat message |
| ~~[textchat:deleteMessage](#delete-textchat-message)~~ | websocket | Delete textchat message |
| ~~[textchat:restoreMessage](#restore-textchat-message)~~ | websocket | Restore textchat message |
| ~~[textchat:sendMessageToRoom](#send-textchat-message-to-room)~~ | websocket | Send textchat message to room |
| ~~[textchat:sendMessageToVideochat](#send-textchat-message-to-videochat)~~ | websocket | Send textchat message to videochat |
| ~~[textchat:listMessagesInRoom](#list-textchat-messages-in-room)~~ | websocket | List textchat messages in room |
| ~~[textchat:listMessagesInVideochat](#list-textchat-messages-in-videochat)~~ | websocket | List textchat messages in videochat |
| ~~[textchat:setTextchatAsImportant](#set-textchat-as-important)~~ | websocket | Set textchat as important |
| ~~[textchat:setTextchatAsNotImportant](#set-textchat-as-not-important)~~ | websocket | Set textchat as not important |
| ~~[textchat:deleteTextchat](#delete-textchat)~~ | websocket | Delete textchat |
| ~~[textchat:onMessage](#on-textchat-message)~~ | websocketEvent | On textchat message |
| ~~[textchat:onMessageEdited](#on-textchat-message-edited)~~ | websocketEvent | On textchat message edited |
| ~~[textchat:onMessageBlocked](#on-textchat-message-blocked)~~ | websocketEvent | On textchat message blocked |
| ~~[textchat:onMessageUnblocked](#on-textchat-message-unblocked)~~ | websocketEvent | On textchat message unblocked |
| ~~[textchat:onMessageDeleted](#on-textchat-message-deleted)~~ | websocketEvent | On textchat message deleted |
| ~~[textchat:onMessageRestored](#on-textchat-message-restored)~~ | websocketEvent | On textchat message restored |
| ~~[textchat:onMessagesRead](#on-textchat-messages-read)~~ | websocketEvent | On textchat messages read |
| ~~[textchat:directCounterUpdated](#on-unread-direct-textchat-count-updated)~~ | websocketEvent | On unread direct textchat count updated |
| ~~[textchat:onMessageInRoom](#on-textchat-message-in-room)~~ | websocketEvent | On textchat message in room |
| ~~[textchat:onMessageInVideochat](#on-textchat-message-in-videochat)~~ | websocketEvent | On textchat message in videochat |

### Get textchat for room

**Method:** websocket

**Endpoint:** textchat:getTextchatForRoom

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api gets/creates textchat for room and subscribes socket to that textchat.

**Request:**

**Response:**

### Get textchat for prop

**Method:** websocket

**Endpoint:** textchat:getTextchatForProp

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api gets/creates textchat for prop and subscribes socket to that textchat.

**Request:**

**Response:**

### Get textchat for videochat

**Method:** websocket

**Endpoint:** textchat:getTextchatForVideochat

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api gets/creates textchat for videochat and subscribes socket to that textchat.

**Request:**

**Response:**

### Get textchat for user (direct textchat)

**Method:** websocket

**Endpoint:** textchat:getTextchatForUser

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api gets/creates direct textchat with user and subscribes socket to that textchat. User can have textchat with himself by putting his own user id to targetUser field.

**Request:**

**Response:**

### Get last textchat message

**Method:** websocket

**Endpoint:** textchat:getLastMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns last message of textchat (does not update last read timestamp).

**Request:**

**Response:**

### List textchat messages

**Method:** websocket

**Endpoint:** textchat:listMessages

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api subscribes socket to textchat events and returns list of textchat messages.

Field `messageType` could be one of:

* 0 - my messages
* 1 - user messages
* 3 - system messages
* 4 - system json messages

In case of system json message, parsed json is sent in message body:

Field `event` could be one of:

* 1 - user entered booth
* 2 - user wrote to booth
* 3 - user entered social circle
* 4 - user wrote to social circle

**Request:**

**Response:**

### Mark textchat as read

**Method:** websocket

**Endpoint:** textchat:markTextchatAsRead

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api sets lastReadMessage to current time for textchat.

**Request:**

**Response:**

### List textchats

**Method:** websocket

**Endpoint:** textchat:listTextchats

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns list of all textchats depending on filters.

Filter could be one of the following:

* important - return textchats marked as important
* all - return all textchats
* direct - return direct textchats
* group - return all non-direct textchats
* allWithinRoom - return all non-direct textchats within the room
* rooms - return only room textchats
* noProps - return all textchats (excluding prop textchats)

**Request:**

**Response:**

### List room textchats

**Method:** websocket

**Endpoint:** textchat:listRoomTextchats

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns list of textchats in the room (including prop textchats) where user have been participated. Textchats are sorted by last message time, starting from newest.

**Request:**

**Response:**

### List direct textchats

**Method:** websocket

**Endpoint:** textchat:listDirectTextchats

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns list of direct textchats where user have been participated. Textchats are sorted by last message time, starting from newest.

**Request:**

**Response:**

### Search textchats

**Method:** websocket

**Endpoint:** textchat:searchTextchats

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns list of all textchats depending on filters.

Filter could be one of the following:

* important - return textchats marked as important
* all - return all textchats
* direct - return direct textchats
* group - return all non-direct textchats
* allWithinRoom - return all non-direct textchats within the room
* rooms - return only room textchats
* noProps - return all textchats (excluding prop textchats)

**Request:**

**Response:**

### Search direct textchats

**Method:** websocket

**Endpoint:** textchat:searchDirectTextchats

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns list of direct textchats where user have been participated. Textchats are filtered by opponent first or last name parts present in search query. Textchats are sorted by last message time, starting from newest.

**Request:**

**Response:**

### Get unread direct textchat counter

**Method:** websocket

**Endpoint:** textchat:getDirectCounter

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Api returns amount of unread direct textchat channels.

**Request:**

**Response:**

### Send textchat message

**Method:** websocket

**Endpoint:** textchat:sendMessage

**DEPRECATED**

**Description:** This endpoint is deprecated as it sends new message event to initiator socket, use textchat:sendNewMessage instead.

**Request:**

**Response:**

### Send new textchat message

**Method:** websocket

**Endpoint:** textchat:sendNewMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Edit textchat message

**Method:** websocket

**Endpoint:** textchat:editMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Block textchat message

**Method:** websocket

**Endpoint:** textchat:blockMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Unblock textchat message

**Method:** websocket

**Endpoint:** textchat:unblockMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Delete textchat message

**Method:** websocket

**Endpoint:** textchat:deleteMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Restore textchat message

**Method:** websocket

**Endpoint:** textchat:restoreMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Send textchat message to room

**Method:** websocket

**Endpoint:** textchat:sendMessageToRoom

**DEPRECATED**

**Description:** Api function is deprecated, use textchat:getTextchatForRoom and textchat:sendMessage instead.

**Request:**

**Response:**

### Send textchat message to videochat

**Method:** websocket

**Endpoint:** textchat:sendMessageToVideochat

**DEPRECATED**

**Description:** Api function is deprecated, use textchat:getTextchatForVideochat and textchat:sendMessage instead.

**Request:**

**Response:**

### List textchat messages in room

**Method:** websocket

**Endpoint:** textchat:listMessagesInRoom

**DEPRECATED**

**Description:** Api function is deprecated, use textchat:getTextchatForRoom and textchat:listMessages instead.

**Request:**

**Response:**

### List textchat messages in videochat

**Method:** websocket

**Endpoint:** textchat:listMessagesInVideochat

**DEPRECATED**

**Description:** Api function is deprecated, use textchat:getTextchatForVideochat and textchat:listMessages instead.

**Request:**

**Response:**

### Set textchat as important

**Method:** websocket

**Endpoint:** textchat:setTextchatAsImportant

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Set textchat as not important

**Method:** websocket

**Endpoint:** textchat:setTextchatAsNotImportant

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Request:**

**Response:**

### Delete textchat

**Method:** websocket

**Endpoint:** textchat:deleteTextchat

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

API deletes direct textchat.

**Request:**

**Response:**

### On textchat message

**Event:** textchat:onMessage

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat message edited

**Event:** textchat:onMessageEdited

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat message blocked

**Event:** textchat:onMessageBlocked

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat message unblocked

**Event:** textchat:onMessageUnblocked

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat message deleted

**Event:** textchat:onMessageDeleted

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat message restored

**Event:** textchat:onMessageRestored

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On textchat messages read

**Event:** textchat:onMessagesRead

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

**Data:**

### On unread direct textchat count updated

**Event:** textchat:directCounterUpdated

**DEPRECATED**

**Description:** Deprecated, Use [Channel API](channel.md) instead .

Event is triggered when counter of unread direct textchat channels is updated.

**Data:**

### On textchat message in room

**Event:** textchat:onMessageInRoom

**DEPRECATED**

**Description:** Api event is deprecated, use textchat:onMessage instead.

**Data:**

### On textchat message in videochat

**Event:** textchat:onMessageInVideochat

**DEPRECATED**

**Description:** Api event is deprecated, use textchat:onMessage instead.

**Data:**

## Models

#### User Simple
