Special Response

These are response types that are supported in CH which may not be yet available in chatbot client’s response options. For AWS Lex, these can be configured in the Custom Payload Response.

Types of Special Response

  1. Card - shows up a set of cards in the response.

  2. Pause - pauses in between messages with the specified time in milliseconds (ms).

  3. Button - shows a single message (title) and a set of options as choices.

  4. Text - shows a single message

  5. File - attach a file as part of the response.

[Note: provide sample look in channels]

Special Responses in Lex Console

Special Responses can be configured in the Custom Payload Response. A special response object should be a valid JSON with special_response as the key with the value as an array of responses or a single object response. Since Custom Payload Responses in Lex are limited to 1000 characters, it is recommended to minify the JSON or use the single response format.

You can configure multiple custom payloads with special responses using array and/or object format as needed. Responses are sent back in the order they appear in Lex console or as configured in the connected Lambda function.

Special Response Array Format

This includes all the supported types for reference.

{
        "special_response": [
            {
                "type": "text",
                "text": "This shows up as normal text."
            },
            {
                "type": "pause",
                "time": 2000
            },
            {
                "type": "button",
                "buttons": {
                    "title": "Please choose from one of the following:",
                    "options": [
                        {
                            "label": "Leave Contact Details",
                            "value": "Leave Contact Details"
                        },
                        {
                            "label": "Chat to Agent",
                            "value": "Chat to Agent"
                        }
                    ]
                }
            },
            {
                "type": "cards",
                "cards": [
                    {
                        "text": "Card text",
                        "description": "Card description",
                        "image_url": "http://image.jpg",
                        "link": "http://link.com"
                    },
                    {
                        "text": "Card text",
                        "description": "Card description",
                        "image_url": "http://image.jpg",
                        "link": "http://link.com"
                    },
                    {
                        "text": "Card text",
                        "description": "Card description",
                        "image_url": "http://image.jpg",
                        "link": "http://link.com"
                    }
                ]
            },
            {
                "type": "file",
                "title": "This is the image",
                "files": [
                    {
                        "mimetype": "image/png",
                        "url": "http://image.jpg",
                        "filename": null,
                        "size": null,
                        "thumbnail": null
                    }
                ]
            }
        ]
    }

Example Array format in Lex Console

Special Response Object format

If your special responses do not fit the 1000-charater limit even when minified, you can opt to configure each response in separate custom payloads. Responses will be received in the order configured in Lex console.

    {
        "special_response": {
            "text": "Hi. I'm the Captivate Bot.",
            "type": "text"
        }
    }

Example Object format in Lex Console

Last updated