Skip to content

Latest commit

 

History

History
121 lines (94 loc) · 7.29 KB

File metadata and controls

121 lines (94 loc) · 7.29 KB

Quick Replies

Required Structure

{
  "quickReplies": {
    "text": string,
    "options": [
      array of objects
    ]
  }
}

Params

Param Name Param Type Description Dependency Example
text String The title of the collection of quick replies. Optional "text": "Sorry I don't know the answer. Please select one of the following options:"
options Array The collection of quick replies objects. Required "options": [ { "text": "Start chat with agent", "actionId": "sflaia-start-chat", "buttonStyle" : "primary" } ]
imagecards Array The collection of image card objects. Optional "imagecards": [ { "subtitle": "[Select Ok to continue]", "buttons": { "buttonStyle": "primary", "text": "OK" } ], "title": "Please refer to the following image:", "image_url": "https://images.acc.viasat.io/1565903104.jpg" } ]

options Params

Param Name Param Type Description Dependency Acceptable Values Example
text String Title of the quick replies action. Required Any "text": "Start Chat"
url String Redirect Url in-case you wish to redirect user somewhere if they click on the button.
⚠️ Recommended to only use with Livechat conversations
Optional Any "text": "Start Chat"
actionId String Id of the quick replies action. Optional Any "actionId": "sflaia-start-chat"
buttonStyle String Button style of your quick replies action. Use danger to render a red colour action and primary for an action that matches your Livechat Bar colour. Optional danger or primary "buttonStyle": "primary"

imagecards Params

  • Table of parameters:
Param Name Param Type Description Dependency Acceptable Values Example
image_url String URL of the image. Required Any "image_url": "https://images.acc.viasat.io/1565903104.jpg"
title String Title of the message. Optional Any "title": "OK"
subtitle String Subtitle of the message. Optional Any "subtitle": "[Click OK to continue]"
buttons Array Array of buttons. Optional Any "buttons": [ { "buttonStyle": "primary", "text": "OK" } ]
  • Example Usage:
{
  "quickReplies": {
    "imagecards": [
      {
        "subtitle": "[Select Ok to continue]",
        "buttons": [
          {
            "buttonStyle": "primary",
            "text": "OK"
          }
        ],
        "title": "Please refer to the following image:",
        "image_url": "https://images.acc.viasat.io/1565903104.jpg"
      }
    ]
  }
}

Pre-Programmed Buttons

These buttons perform a specific action in the app. You can add them by simply pasting the following block in your Quick Replies payload. Note: You can change the text and buttonStyle parameters as per your requirements, but only use the provided actionId for the button you want to add.

Handover Button

  • On clicking this button, the visitor will be handed over to another departement. You can set the target department in the app setting called Target Department for Handover or add a departmentName param in your payload. On failing to provide a department name in either way, will send a request failure message back to the visitor, when visitor clicks the button.

  • Add the following block in your Quick Replies payload, with actionId set as df_perform_handover, to include this button in your response:

  • Parameters:

Param Name Dependency Param Type Acceptable Value
actionId Required String df_perform_handover
text Required String Any
buttonStyle Optional String primary or danger
data.departmentName Optional Object Any Omnichannel department name
  • Example Structure:
{
   "text": "Perform Handover",
   "buttonStyle": "primary",
   "actionId": "df_perform_handover",
   "data": {
      "departmentName": "sales"
   }
}

Close Chat Button

  • When visitor clicks this button, the chat session will be closed. Add the following block in your Quick Replies payload, with actionId set as df_close_chat, to include this button in your response:

  • Parameters:

Param Name Dependency Param Type Acceptable Value
actionId Required String df_close_chat
text Required String Any
buttonStyle Optional String primary or danger
  • Example Structure:
{
   "text": "Close Chat",
   "buttonStyle": "danger",
   "actionId": "df_close_chat"
}

Example

Pre-Programmed Example Payload