Skip to content

Commit edf50b2

Browse files
authored
feat: add send_greeting_postback customer's method (#1572)
1 parent a4ff4c5 commit edf50b2

File tree

3 files changed

+130
-2
lines changed

3 files changed

+130
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ The developer preview version provides a preview of the upcoming changes to the
3636

3737
- The **customer_page_updated** was removed.
3838

39+
### Other
40+
41+
- There's a new method, [**Send Greeting Postback**](/messaging/customer-chat-api/v3.6/#send-greeting-postback).
3942

4043
## [v3.5] - 2022-11-23
4144

src/pages/messaging/customer-chat-api/v3.6/index.mdx

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ curl -X POST \
106106
| **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) [`list_license_properties`](#list-license-properties) [`list_group_properties`](#list-group-properties) |
107107
| **Customers** | [`update_customer`](#update-customer) [`set_customer_session_fields`](#set-customer-session-fields) [`get_customer`](#get-customer) |
108108
| **Status** | [`list_group_statuses`](#list-group-statuses) |
109-
| **Other** | [`check_goals`](#check-goals) [`get_form`](#get-form) [`get_predicted_agent`](#get-predicted-agent) [`get_url_info`](#get-url-info) [`mark_events_as_seen`](#mark-events-as-seen) [`accept_greeting`](#accept-greeting) [`cancel_greeting`](#cancel-greeting) [`request_email_verification`](#request-email-verification) |
109+
| **Other** | [`check_goals`](#check-goals) [`get_form`](#get-form) [`get_predicted_agent`](#get-predicted-agent) [`get_url_info`](#get-url-info) [`mark_events_as_seen`](#mark-events-as-seen) [`accept_greeting`](#accept-greeting) [`cancel_greeting`](#cancel-greeting) [`request_email_verification`](#request-email-verification) [`send_greeting_postback`](#send-greeting-postback) |
110110

111111
## Chats
112112

@@ -2184,6 +2184,63 @@ curl -X POST \
21842184

21852185
<Text>
21862186

2187+
### Send Greeting Postback
2188+
2189+
#### Specifics
2190+
2191+
| | |
2192+
| ---------------------- | --------------------------------------------------------------------------------------------------- |
2193+
| **Method URL** | `https://api.livechatinc.com/v3.6/customer/action/send_greeting_postback` |
2194+
| **RTM API equivalent** | [`send_greeting_postback`](/messaging/customer-chat-api/v3.6/rtm-reference/#send-greeting-postback) |
2195+
| **Webhook** | - |
2196+
2197+
#### Request
2198+
2199+
| Parameter | Required | Data type | Notes |
2200+
| ------------------------------- | -------- | --------- | --------------------------------------------------- |
2201+
| `greeting_unique_id` | Yes | `string` | |
2202+
| `postback` | Yes | `object` | |
2203+
| `postback.rich_message` | No | `object` | Required if `postback.url` is not provided |
2204+
| `postback.rich_message.id` | Yes | `string` | Postback name of the button |
2205+
| `postback.rich_message.toggled` | Yes | `bool` | Postback toggled; `true` or `false` |
2206+
| `postback.url` | No | `string` | Required if `postback.rich_message` is not provided |
2207+
2208+
#### Response
2209+
2210+
No response payload (`200 OK`).
2211+
2212+
</Text>
2213+
2214+
<Code>
2215+
2216+
<CodeSample path={'REQUEST'}>
2217+
2218+
```shell
2219+
curl -X POST \
2220+
'https://api.livechatinc.com/v3.6/customer/action/send_greeting_postback?organization_id=<organization_id>' \
2221+
-H 'Content-Type: application/json' \
2222+
-H 'Authorization: Bearer <customer_access_token>' \
2223+
-d '{
2224+
"greeting_unique_id": "Q10X0W041P",
2225+
"postback": {
2226+
"rich_message": {
2227+
"id": "greeting_button_yes",
2228+
"toggled": true
2229+
}
2230+
}
2231+
}'
2232+
```
2233+
2234+
</CodeSample>
2235+
2236+
</Code>
2237+
2238+
</Section>
2239+
2240+
<Section>
2241+
2242+
<Text>
2243+
21872244
### Request Email Verification
21882245

21892246
Requests the verification of the customer's email address by sending them a verification email with the identity confirmation link.

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

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ When connecting to the Customer Chat RTM API, clients have to send over the requ
105105
| **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) |
106106
| **Customers** | [`update_customer`](#update-customer) [`update_customer_page`](#update-customer-page) [`set_customer_session_fields`](#set-customer-session-fields) [`get_customer`](#get-customer) |
107107
| **Status** | [`login`](#login) [`list_group_statuses`](#list-group-statuses) |
108-
| **Other** | [`get_form`](#get-form) [`get_predicted_agent`](#get-predicted-agent) [`get_url_info`](#get-url-info) [`mark_events_as_seen`](#mark-events-as-seen) [`accept_greeting`](#accept-greeting) [`cancel_greeting`](#cancel-greeting) |
108+
| **Other** | [`get_form`](#get-form) [`get_predicted_agent`](#get-predicted-agent) [`get_url_info`](#get-url-info) [`mark_events_as_seen`](#mark-events-as-seen) [`accept_greeting`](#accept-greeting) [`cancel_greeting`](#cancel-greeting) [`send_greeting_postback`](#send-greeting-postback) |
109109

110110
</Text>
111111

@@ -2198,6 +2198,74 @@ Cancels a greeting (an invitation to the chat). For example, Customers could can
21982198

21992199
<Text>
22002200

2201+
### Send Greeting Postback
2202+
2203+
#### Specifics
2204+
2205+
| | |
2206+
| ---------------------- | ------------------------------------------------------------------------------------- |
2207+
| **Action** | `send_greeting_postback` |
2208+
| **Web API equivalent** | [`send_greeting_postback`](/messaging/customer-chat-api/v3.6/#send-greeting-postback) |
2209+
| **Push message** | - |
2210+
2211+
#### Request
2212+
2213+
| Parameter | Required | Data type | Notes |
2214+
| ------------------------------- | -------- | --------- | --------------------------------------------------- |
2215+
| `greeting_unique_id` | Yes | `string` | |
2216+
| `postback` | Yes | `object` | |
2217+
| `postback.rich_message` | No | `object` | Required if `postback.url` is not provided |
2218+
| `postback.rich_message.id` | Yes | `string` | Postback name of the button |
2219+
| `postback.rich_message.toggled` | Yes | `bool` | Postback toggled; `true` or `false` |
2220+
| `postback.url` | No | `string` | Required if `postback.rich_message` is not provided |
2221+
2222+
</Text>
2223+
2224+
<Code>
2225+
2226+
<CodeSample path={'REQUEST'}>
2227+
2228+
```json
2229+
{
2230+
"action": "send_greeting_postback",
2231+
"payload": {
2232+
"greeting_unique_id": "Q10X0W041P",
2233+
"postback": {
2234+
"rich_message": {
2235+
"id": "greeting_button_yes",
2236+
"toggled": true
2237+
}
2238+
}
2239+
}
2240+
}
2241+
```
2242+
2243+
</CodeSample>
2244+
2245+
<CodeResponse>
2246+
2247+
```json
2248+
{
2249+
"request_id": "<request_id>", // optional
2250+
"action": "send_greeting_postback",
2251+
"type": "response",
2252+
"payload": {
2253+
// no response payload
2254+
},
2255+
"success": true
2256+
}
2257+
```
2258+
2259+
</CodeResponse>
2260+
2261+
</Code>
2262+
2263+
</Section>
2264+
2265+
<Section>
2266+
2267+
<Text>
2268+
22012269
# Pushes
22022270

22032271
Here's what you need to know about **pushes**:

0 commit comments

Comments
 (0)