Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/messaging/agent-chat-api/changelog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The developer preview version provides a preview of the upcoming changes to the
- A new structure for the [**Deleted Event**](/messaging/agent-chat-api/v3.6/data-structures/#deleted-event) was added.
- There are new pushes:
- [**event_deleted**](/messaging/agent-chat-api/v3.6/rtm-pushes/#event_deleted)
- There's a new method, **Send Event Preview** ([Web](/messaging/agent-chat-api/v3.6/#send-event-preview) & [RTM](/messaging/agent-chat-api/v3.6/rtm-reference/#send-event-preview)).

### Customers

Expand Down
57 changes: 56 additions & 1 deletion src/pages/messaging/agent-chat-api/v3.6/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ curl -X POST \
| **Chats** | [`list_chats`](#list-chats) [`list_threads`](#list-threads) [`get_chat`](#get-chat) [`list_archives`](#list-archives) [`start_chat`](#start-chat) [`resume_chat`](#resume-chat) [`deactivate_chat`](#deactivate-chat) [`follow_chat`](#follow-chat) [`unfollow_chat`](#unfollow-chat) |
| **Chat access** | [`transfer_chat`](#transfer-chat) |
| **Chat users** | [`add_user_to_chat`](#add-user-to-chat) [`remove_user_from_chat`](#remove-user-from-chat) |
| **Events** | [`send_event`](#send-event) [`upload_file`](#upload-file) [`send_rich_message_postback`](#send-rich-message-postback) |
| **Events** | [`send_event_preview`](#send-event-preview) [`send_event`](#send-event) [`upload_file`](#upload-file) [`send_rich_message_postback`](#send-rich-message-postback) |
| **Properties** | [`update_chat_properties`](#update-chat-properties) [`delete_chat_properties`](#delete-chat-properties) [`update_thread_properties`](#update-thread-properties) [`delete_thread_properties`](#delete-thread-properties) [`update_event_properties`](#update-event-properties) [`delete_event_properties`](#delete-event-properties) |
| **Thread tags** | [`tag_thread`](#tag-thread) [`untag_thread`](#untag-thread) |
| **Customers** | [`get_customer`](#get-customer) [`create_customer`](#create-customer) [`update_customer`](#update-customer) [`ban_customer`](#ban-customer) [`follow_customer`](#follow-customer) [`unfollow_customer`](#unfollow-customer) |
Expand Down Expand Up @@ -1185,6 +1185,61 @@ https://api.livechatinc.com/v3.6/agent/action/remove_user_from_chat \
<Section>
<Text>

### Send Event Preview

Sends an [event](/messaging/agent-chat-api/v3.6/data-structures/#events) that isn't saved in the chat. Use this method when you're preparing a longer response and want to send a partial update before sending the final message with [Send Event](/messaging/agent-chat-api/v3.6/#send-event). Only [Message](/messaging/agent-chat-api/v3.6/data-structures/#message) is supported. Visibility must be set to `all` or skipped. The user must be [added to the chat](/messaging/agent-chat-api/rtm-pushes/#user_added_to_chat) before they can send an event.

#### Specifics

| | |
| ---------------------- | ---------------------------------------------------------------------------------------- |
| **Method URL** | `https://api.livechatinc.com/v3.6/agent/action/send_event_preview` |
| **Required scopes** | `chats--all:rw` **\*** or `chats--access:rw` **\*\*** |
| **RTM API equivalent** | [`send_event_preview`](/messaging/agent-chat-api/v3.6/rtm-reference/#send-event_preview) |
| **Webhook** | - |

**\*)** `chats--all:rw` - to send an event to a chat taking place in any group.

**\*\*)** `chats--access:rw` - to send an event to a chat taking place in groups that the requester (related to the token) is a member of. (The agent groups and the chat groups must overlap - at least one group must be in common.)

#### Request

| Parameter | Required | Data type | Notes |
| --------- | -------- | --------- | ------------------------------------------------------------------------------------------------ |
| `chat_id` | Yes | `string` | Id of the chat you want to send a message to. |
| `event` | Yes | `object` | [Event](/messaging/agent-chat-api/data-structures/#events) object. Supports only `message` type. |

#### Response

No response payload (`200 OK`).

</Text>
<Code>
<CodeSample path={'REQUEST'}>

```shell
curl -X POST \
https://api.livechatinc.com/v3.6/agent/action/send_event_preview \
-H 'Authorization: Bearer <your_access_token>' \
-H 'Content-Type: application/json' \
-d '{
"chat_id": "PW94SJTGW6",
"event": {
"type": "message",
"text": "Preview of a longer response...",
"visibility": "all",
"custom_id": "31-0C-1C-07-DB-16"
}
}'
```

</CodeSample>
</Code>
</Section>

<Section>
<Text>

### Send Event

Sends an [Event](/messaging/agent-chat-api/v3.6/data-structures/#events) object. Use this method to send a message by specifying the [Message](/messaging/agent-chat-api/v3.6/data-structures/#message) event type in the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ When connecting to the Agent Chat RTM API, clients have to send over the require
| **Chats** | [`list_chats`](#list-chats) [`list_threads`](#list-threads) [`get_chat`](#get-chat) [`list_archives`](#list-archives) [`start_chat`](#start-chat) [`resume_chat`](#resume-chat) [`deactivate_chat`](#deactivate-chat) [`follow_chat`](#follow-chat) [`unfollow_chat`](#unfollow-chat) |
| **Chat access** | [`transfer_chat`](#transfer-chat) |
| **Chat users** | [`add_user_to_chat`](#add-user-to-chat) [`remove_user_from_chat`](#remove-user-from-chat) |
| **Events** | [`send_event`](#send-event) [`send_rich_message_postback`](#send-rich-message-postback) |
| **Events** | [`send_event_preview`](#send-event-preview) [`send_event`](#send-event) [`send_rich_message_postback`](#send-rich-message-postback) |
| **Properties** | [`update_chat_properties`](#update-chat-properties) [`delete_chat_properties`](#delete-chat-properties) [`update_thread_properties`](#update-thread-properties) [`delete_thread_properties`](#delete-thread-properties) [`update_event_properties`](#update-event-properties) [`delete_event_properties`](#delete-event-properties) |
| **Thread tags** | [`tag_thread`](#tag-thread) [`untag_thread`](#untag-thread) |
| **Customers** | [`get_customer`](#get-customer) [`create_customer`](#create-customer) [`update_customer`](#update-customer) [`ban_customer`](#ban-customer) [`follow_customer`](#follow-customer) [`unfollow_customer`](#unfollow-customer) [`subscribe_customers`](#subscribe_customers) [`unsubscribe_customers`](#unsubscribe_customers) |
Expand Down Expand Up @@ -1319,6 +1319,72 @@ Removes a user from chat. The following restrictions apply:

## Events

### Send Event Preview

Sends an [event](/messaging/agent-chat-api/v3.6/data-structures/#events) that isn't saved in the chat. Use this method when you're preparing a longer response and want to send a partial update before sending the final message with [Send Event](/messaging/agent-chat-api/v3.6/rtm-reference#send-event). Only [Message](/messaging/agent-chat-api/v3.6/data-structures/#message) is supported. Visibility must be set to `all` or skipped. The user must be [added to the chat](/messaging/agent-chat-api/rtm-pushes/#user_added_to_chat) before they can send an event.

#### Specifics

| |
| ---------------------- | -------------------------------------------------------------------------- |
| **Action** | `send_event_preview` |
| **Required scopes** | `chats--all:rw` **\*** or `chats--access:rw` **\*\*** |
| **Web API equivalent** | [`send_event_preview`](/messaging/agent-chat-api/v3.6/#send-event-preview) |
| **Push message** | - |

**\*)** `chats--all:rw` - to send an event to a chat taking place in any group.

**\*\*)** `chats--access:rw` - to send an event to a chat taking place in groups that the requester (related to the token) is a member of. (The agent groups and the chat groups must overlap - at least one group must be in common.)

#### Request

| Parameters | Required | Data type | Notes |
| ---------- | -------- | --------- | ------------------------------------------------------------------------------------------------ |
| `chat_id` | Yes | `string` | Id of the chat you want to send the message to. |
| `event` | Yes | `object` | [Event](/messaging/agent-chat-api/data-structures/#events) object. Supports only `message` type. |

</Text>
<Code>
<CodeSample path={'REQUEST'}>

```json
{
"action": "send_event",
"payload": {
"chat_id": "PW94SJTGW6",
"event": {
"type": "message",
"text": "Preview of a longer response...",
"visibility": "all",
"custom_id": "31-0C-1C-07-DB-16"
}
}
}
```

</CodeSample>

<CodeResponse>

```json
{
"request_id": "<request_id>", // optional
"action": "send_event_preview",
"type": "response",
"success": true,
"payload": {
//no response payload
}
}
```

</CodeResponse>
</Code>
</Section>

<Section>
<Text>

### Send Event

Sends an [Event](/messaging/agent-chat-api/v3.6/data-structures/#events) object. Use this method to send a message by specifying the [Message](/messaging/agent-chat-api/v3.6/data-structures/#message) event type in the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The developer preview version provides a preview of the upcoming changes to the
- There's a new method, **Delete Event** ([Web](/messaging/customer-chat-api/v3.6/#delete-event) and [RTM](/messaging/customer-chat-api/v3.6/rtm-reference#delete-event)).
- There are new pushes:
- [**event_deleted**](/messaging/customer-chat-api/v3.6/rtm-pushes/#event_deleted)
- [**incoming_event_preview**](/messaging/customer-chat-api/v3.6/rtm-pushes/#incoming_event_preview)

### Customers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here's what you need to know about **pushes**:
| **Chats** | [`incoming_chat`](#incoming_chat) [`chat_deactivated`](#chat_deactivated) |
| **Chat access** | [`chat_transferred`](#chat_transferred) |
| **Chat users** | [`user_added_to_chat`](#user_added_to_chat) [`user_removed_from_chat`](#user_removed_from_chat) |
| **Events** | [`incoming_event`](#incoming_event) [`event_deleted`](#event_deleted) [`event_updated`](#event_updated) [`incoming_rich_message_postback`](#incoming_rich_message_postback) |
| **Events** | [`incoming_event_preview`](#incoming_event_preview) [`incoming_event`](#incoming_event) [`event_deleted`](#event_deleted) [`event_updated`](#event_updated) [`incoming_rich_message_postback`](#incoming_rich_message_postback) |
| **Properties** | [`chat_properties_updated`](#chat_properties_updated) [`chat_properties_deleted`](#chat_properties_deleted) [`thread_properties_updated`](#thread_properties_updated) [`thread_properties_deleted`](#thread_properties_deleted) [`event_properties_updated`](#event_properties_updated) [`event_properties_deleted`](#event_properties_deleted) |
| **Customers** | [`customer_updated`](#customer_updated) [`customer_side_storage_updated`](#customer_side_storage_updated) |
| **Status** | [`customer_disconnected`](#customer_disconnected) [`groups_status_updated`](#groups_status_updated) |
Expand Down Expand Up @@ -214,6 +214,28 @@ Informs that a user (Customer or Agent) was removed from a chat.

## Events

### `incoming_event_preview`

Informs about an incoming [event](/messaging/customer-chat-api/v3.6/data-structures/#events) preview sent to a chat.

<CodeResponse title={'Sample push payload'}>

```json
{
"chat_id": "PJ0MRSHTDG",
"thread_id": "K600PKZON8",
"event": {
"created_at": "2019-12-05T07:27:08.820000Z",
"type": "message",
"text": "Preview of a longer response...",
"author_id": "b5657aff-34dd-32e1-98160d54666df9d8",
"custom_id": "31-0C-1C-07-DB-16"
}
}
```

</CodeResponse>

### `incoming_event`

Informs about an incoming [event](/messaging/customer-chat-api/v3.6/data-structures/#events) sent to a chat.
Expand Down