Action
    • PDF

    Action

    • PDF

    Article summary

    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.

    FieldTypeRequiredDescription
    typeStringRequiredComponent type
    • Only postback is available for the Postback component
    dataObjectRequiredPostback component configuration information
    data.postbackStringRequiredText displayed in user chat
    • Sending to chatbot does not impact existing features, but may not support some new features
    data.postbackFullStringRequiredEntire 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.

    FieldTypeRequiredDescription
    typeStringRequiredComponent type
    • Only utterance is available for the Utterance component
    dataObjectRequiredUtterance component configuration information
    data.utteranceIdIntegerRequiredUtterance ID
    data.textStringRequiredText that appears as user input in the chat
    data.postbackStringRequiredPostback 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"
        }
    }
    

    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.

    FieldTypeRequiredDescription
    typeStringRequiredComponent type
    • Only link is available for the Link component
    dataObjectRequiredLink component configuration information
    data.urlStringRequiredURL address
    data.mobileUrlStringRequiredMobile 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.

    FieldTypeRequiredDescription
    typeStringRequiredComponent type
    • Only phone is available for the Phone component
    dataObjectRequiredPhone component configuration information
    data.numberStringRequiredPhone number
    data.nameStringOptionalName 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.

    FieldTypeRequiredDescription
    typeStringRequiredComponent type
    • Only welcome is available for the Welcome component
    dataObjectRequiredWelcome component configuration information
    data.postbackStringRequiredPostback 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" 
        } 
    }
    

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.