Skip to content

Commit fa59d5b

Browse files
committed
agent-api: subcribe_customers et consortes
1 parent a72e728 commit fa59d5b

File tree

3 files changed

+132
-2
lines changed

3 files changed

+132
-2
lines changed

src/pages/messaging/agent-chat-api/changelog/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ The developer preview version provides a preview of the upcoming changes to the
3131
### Customers
3232

3333
- The **List Customers** method was removed.
34+
- The **Subscribe Customers** ([RTM](/messaging/agent-chat-api/v3.6/rtm-reference/#subscribe_customers)) and **Unsubscribe Customers** ([RTM](/messaging/agent-chat-api/v3.6/rtm-reference/#unsubscribe_customers)) methods along with a [**subscribed_customers_totals_updated**](/messaging/agent-chat-api/v3.6/rtm-pushes/#subscribed_customers_totals_updated) push were added.
3435

3536
### Status
3637

src/pages/messaging/agent-chat-api/v3.6/rtm-pushes/index.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Here's what you need to know about **pushes**:
3535
| **Events** | [`incoming_event`](#incoming_event) [`event_updated`](#event_updated)[`incoming_rich_message_postback`](#incoming_rich_message_postback) |
3636
| **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) |
3737
| **Thread tags** | [`thread_tagged`](#thread_tagged) [`thread_untagged`](#thread_untagged) |
38-
| **Customers** | [`incoming_customers`](#incoming_customers) [`incoming_customer`](#incoming_customer) [`customer_updated`](#customer_updated) [`customer_page_updated`](#customer_page_updated) [`customer_banned`](#customer_banned) [`customer_transferred`](#customer_transferred) [`customer_left`](#customer_left) |
38+
| **Customers** | [`incoming_customers`](#incoming_customers) [`incoming_customer`](#incoming_customer) [`customer_updated`](#customer_updated) [`customer_page_updated`](#customer_page_updated) [`customer_banned`](#customer_banned) [`customer_transferred`](#customer_transferred) [`customer_left`](#customer_left) [`subscribed_customers_totals_updated`](#subscribed_customers_totals_updated) |
3939
| **Status** | [`routing_status_set`](#routing_status_set) [`agent_disconnected`](#agent_disconnected) |
4040
| **Configuration** | [`agent_created`](#agent_created) [`agent_approved`](#agent_approved) [`agent_updated`](#agent_updated) [`agent_suspended`](#agent_suspended) [`agent_unsuspended`](#agent_unsuspended) [`agent_deleted`](#agent_deleted) [`auto_accesses_updated`](#auto_accesses_updated) [`bot_created`](#bot_created) [`bot_updated`](#bot_updated) [`bot_deleted`](#bot_deleted) [`group_created`](#group_created) [`group_updated`](#group_updated) [`group_deleted`](#group_deleted) [`tag_created`](#tag_created) [`tag_deleted`](#tag_deleted) [`tag_updated`](#tag_updated) [`groups_status_updated`](#groups_status_updated) |
4141
| **Other** | [`events_marked_as_seen`](#events_marked_as_seen) [`incoming_sneak_peek`](#incoming_sneak_peek) [`incoming_typing_indicator`](#incoming_typing_indicator) [`incoming_multicast`](#incoming_multicast) [`chat_unfollowed`](#chat_unfollowed) [`queue_positions_updated`](#queue_positions_updated) [`customer_unfollowed`](#customer-unfollowed) |
@@ -678,6 +678,19 @@ Informs that a Customer left the tracked website.
678678

679679
</CodeResponse>
680680

681+
### `subscribed_customers_totals_updated`
682+
683+
Informs that number of customers matching subscription changed. This push is sent periodically once limits are reached.
684+
685+
<CodeResponse title={'Sample push payload'}>
686+
687+
```json
688+
{
689+
"b7eff798f8df43648059649c35c9ed0c": 123,
690+
"a0c22fddfb7140b5bfc6a8a0bc3117f7": 321
691+
}
692+
```
693+
681694
## Status
682695

683696
### `routing_status_set`

src/pages/messaging/agent-chat-api/v3.6/rtm-reference/index.mdx

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ To find sample payloads of **events**, **users**, and **other common structures*
125125
| **Events** | [`send_event`](#send-event) [`send_rich_message_postback`](#send-rich-message-postback) |
126126
| **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) |
127127
| **Thread tags** | [`tag_thread`](#tag-thread) [`untag_thread`](#untag-thread) |
128-
| **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) |
128+
| **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) |
129129
| **Status** | [`login`](#login) [`set_routing_status`](#set-routing-status) [`set_away_status`](#set-away-status) [`logout`](#logout) [`list_routing_statuses`](#list-routing-statuses) [`update_session`](#update-session) |
130130
| **Other** | [`mark_events_as_seen`](#mark-events-as-seen) [`send_typing_indicator`](#send-typing-indicator) [`multicast`](#multicast) [`list_agents_for_transfer`](#list-agents-for-transfer) |
131131

@@ -2420,6 +2420,122 @@ Removes the agent from the list of customer's followers. Calling this method on
24202420
<Section>
24212421
<Text>
24222422

2423+
### Subscribe Customers
2424+
2425+
Creates a subscription for customers. Response will contain customers currently matching the criteria. After successful subscription, agent will receive pushes about tracked customers on this rtm connection. If the number of tracked customers is exceeding the limit, push `subscribed_customers_totals_updated` will be periodically sent to indicate total number of customers currenlty matching the criteria.
2426+
2427+
#### Specifics
2428+
2429+
| | |
2430+
| ---------------------- | --------------------------------------------------------------------------------------- |
2431+
| **Action** | `subscribe_customers` |
2432+
| **Required scopes** | `customers:ro` |
2433+
| **Web API equivalent** | - |
2434+
| **Push message** | - |
2435+
2436+
#### Request
2437+
2438+
| Parameter | Required | Data type | |
2439+
| --------- | -------- | --------- | --- |
2440+
| `group_ids` | No | `[]int` | |
2441+
| `limit` | No | int | |
2442+
2443+
</Text>
2444+
<Code>
2445+
<CodeSample path={'REQUEST'}>
2446+
2447+
```json
2448+
{
2449+
"action": "subscribe_customers",
2450+
"payload": {
2451+
"group_ids": [0, 42],
2452+
"limit": 100
2453+
}
2454+
}
2455+
```
2456+
2457+
</CodeSample>
2458+
2459+
<CodeResponse>
2460+
2461+
```json
2462+
{
2463+
"request_id": "<request_id>", // optional
2464+
"action": "subscribe_customers",
2465+
"type": "response",
2466+
"success": true,
2467+
"payload": {
2468+
"subscription_id": "b7eff798f8df43648059649c35c9ed0c",
2469+
"customers": [
2470+
// ...
2471+
]
2472+
}
2473+
}
2474+
```
2475+
2476+
</CodeResponse>
2477+
</Code>
2478+
</Section>
2479+
2480+
<Section>
2481+
<Text>
2482+
2483+
2484+
### Unsubscribe Customers
2485+
2486+
Removes a customers subscription.
2487+
2488+
#### Specifics
2489+
2490+
| | |
2491+
| ---------------------- | --------------------------------------------------------------------------------------- |
2492+
| **Action** | `unsubscribe_customers` |
2493+
| **Required scopes** | `customers:ro` |
2494+
| **Web API equivalent** | - |
2495+
| **Push message** | - |
2496+
2497+
#### Request
2498+
2499+
| Parameter | Required | Data type | |
2500+
| --------- | -------- | --------- | --- |
2501+
| `subscription_id` | Yes | string | |
2502+
2503+
</Text>
2504+
<Code>
2505+
<CodeSample path={'REQUEST'}>
2506+
2507+
```json
2508+
{
2509+
"action": "unsubscribe_customers",
2510+
"payload": {
2511+
"subscription_id": "b7eff798f8df43648059649c35c9ed0c"
2512+
}
2513+
}
2514+
```
2515+
2516+
</CodeSample>
2517+
2518+
<CodeResponse>
2519+
2520+
```json
2521+
{
2522+
"request_id": "<request_id>", // optional
2523+
"action": "subscribe_customers",
2524+
"type": "response",
2525+
"success": true,
2526+
"payload": {
2527+
// no response payload
2528+
}
2529+
}
2530+
```
2531+
2532+
</CodeResponse>
2533+
</Code>
2534+
</Section>
2535+
2536+
<Section>
2537+
<Text>
2538+
24232539
## Status
24242540

24252541
### Login

0 commit comments

Comments
 (0)