Action

Prev Next

Available in Classic and VPC

This document describes the actions in the response component of a chatbot answer. Actions are common data for all components that define what to do when a component is clicked.

An action consists of the following five basic components.

These components allow you to set the chatbot's response to each feature in Chatbot Builder, and return the response results in JSON format.

Postback component

The Postback component posts text (postbackText) to the chatbot and displays the postback text as the user's chat.

Postback component response body

The following is the response body of the Postback component.

Field Type Required Description
type String Required Component type
  • Only postback is available for the Postback component
data Object Required Postback component configuration information
data.postback String Required Text displayed in user chat
  • Sending to chatbot does not impact existing features, but may not support some new features
data.postbackFull String Required Entire postback text to send to the chatbot

Postback component response example

The following is a sample response of the Postback component.

{
    "action": 
    {
        "type": "postback",
        "data": 
        {
            "postback": "Button Name",
            "postbackFull": "_T_Button Name" 
         }
    }
}

Utterance component

The Utterance component posts back text (postbackText) to the chatbot and displays the utterance text as the user's chat.

Utterance component response body

The following is the response body of the Utterance component.

Field Type Required Description
type String Required Component type
  • Only utterance is available for the Utterance component
data Object Required Utterance component configuration information
data.utteranceId Integer Required Utterance ID
data.text String Required Text that appears as user input in the chat
data.postback String Required Postback text to send to the chatbot

Utterance component response example

The following is a sample response of the Utterance component.

{
    "type": "utterance",
    "data" : 
    {
        "utteranceId" : 1,
        "text" : "text show in chat window",
        "postback" : "postback text"
    }
}

Link component

The Link component navigates to its URL when the component is clicked.

Link component response body

The following is the response body of the Link component.

Field Type Required Description
type String Required Component type
  • Only link is available for the Link component
data Object Required Link component configuration information
data.url String Required URL address
data.mobileUrl String Required Mobile URL address

Link component response example

The following is a sample response of the Link component.

{
    "type": "link",
    "data" : 
    {
        "url" : "http://www.ncloud.com",
        "mobileUrl" : "http://m.ncloud.com"
    }
}

Phone component

The Phone component takes you to the dial page when you click the component.

Note

The Phone component is only supported in mobile environments.

Phone component response body

The following is the response body of the Phone component.

Field Type Required Description
type String Required Component type
  • Only phone is available for the Phone component
data Object Required Phone component configuration information
data.number String Required Phone number
data.name String Optional Name registered in contacts

Phone component response example

The following is a sample response of the Phone component.

{
    "type": "phone",
    "data" :   
    { 
        "number" : "400-1111-1111", 
        "name" : "Customer service" 
    }
}

Welcome component

The Welcome component sends an open event when the component is clicked.

Welcome component response body

The following is the response body of the Welcome component.

Field Type Required Description
type String Required Component type
  • Only welcome is available for the Welcome component
data Object Required Welcome component configuration information
data.postback String Required Postback text sent to the chatbot from the open event

Welcome component response example

The following is a sample response of the Welcome component.

{ 
    "type": "welcome", 
    "data" : 
    { 
        "postback" : "postback text, optional" 
    } 
}