Action Objects

    Action objects define actions of a bot when a button or image of a message is pressed.

    Action objects are available in the following messages:

    • Send Messages > Common Message Property > Quick Reply
    • Send Messages (Button Template)
    • Send Messages (List Template)
    • Send Messages (Carousel)
    • Send Messages (Image Carousel)
    • Message Persistent Menu
    • Message Rich Menu

    Available actions are as follows:

    • Postback action
    • Message action
    • URI action
    • Camera action
    • Camera roll action
    • Location action

    Postback Action

    This action can be configured only with buttons of carousel, image carousel, rich menu and quick reply. When an element associated with this action is pressed, a postback event is returned through the callback containing the text string specified in the “data” parameter.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "postback."
    label string See Description Label displayed on an element. It is required, except for “defaultAction” of a rich menu and carousel. If it is not specified for a rich menu, the default message is displayed in the desktop environment.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    data string Y Text string returned through the callback of the postback.data property
    Max length: 300 characters
    displayText string See Description Chat message sent by a user. If not specified, the text is not displayed.
    Note that it is required for quick reply.
    Max length: 300 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    i18nDisplayTexts array N Multilingual display text list
    i18nDisplayTexts[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nDisplayTexts[].displayText string Y Chat message sent by a user.
    Max length: 300 characters

    Request Example

    
    {
      "type": "postback",
      "label": "Buy",
      "data": "action=buy&itemid=111",
      "displayText": "Buy"
    }
    

    Message Action

    When an element associated with this action is pressed, the text string of the “text” property is sent from a user.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "message."
    label string See Description Label displayed on an element. It is required, except for “defaultAction” of a rich menu and carousel. If it is not specified for a rich menu, the default message is displayed in the desktop environment.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters
    text string See Description Text sent when an element is pressed. It is required for carousel, image carousel, rich menu and quick reply, and replaced with the label value for button template, list template and persistent menu.
    Max length: 300 characters
    postback string N Text string returned through the message.postback property
    Max length: 1,000 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters
    i18nTexts array N Multilingual text list
    i18nTexts[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nTexts[].text string Y Text sent when an element is pressed. It is required for carousel, image carousel, rich menu and quick reply, and replaced with the label value for button template, list template and persistent menu.
    Max length: 300 characters

    Request Example

    
    {
      "type": "message",
      "label": "Yes",
      "text": "Yes"
    }
    

    URI Action

    When an element associated with this action is pressed, the URI set in the “uri” property is opened.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "uri."
    label string See Description Label displayed on an element. It is required, except for “defaultAction” of a rich menu and carousel. If it is not specified for a rich menu, the default message is displayed in the desktop environment.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters
    uri string Y The URI is opened when the element is pressed. The “http” and “https” schemas are supported.
    Max length: 1,000 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters

    Request Example

    
    {
      "type": "uri",
      "label": "View details",
      "uri": "http://www.worksmobile.com"
    }
    

    Camera Action

    This action can be configured only with quick reply buttons. When an element associated with this action is pressed, the camera screen is opened.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "camera."
    label string Y Button’s label
    Max length: 20 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters

    Request Example

    
    {
      "type": "camera",
      "label": "Camera"
    }
    

    Camera Roll Action

    This action can be configured only with quick reply buttons. When an element associated with this action is pressed, the camera roll is opened.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "cameraRoll."
    label string Y Button’s label
    Max length: 20 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters

    Request Example

    
    {
      "type": "cameraRoll",
      "label": "Camera roll"
    }
    

    Location Action

    This action can be configured only with quick reply buttons. When an element associated with this action is pressed, the location screen is opened.

    common

    Parameter Type Required Description
    type string Y Set this parameter to "location."
    label string Y Button’s label
    Max length: 20 characters

    multi language

    Parameter Type Required Description
    i18nLabels array N List of multilingual labels
    i18nLabels[].language string Y Language code
    ○ ko_KR ○ ja_JP ○ zh_CN ○ zh_TW ○ en_US
    i18nLabels[].label string Y Label displayed on each element.
    ○ Default max length: 20 characters
    ○ Max length for image carousel: 12 characters
    ○ Max length for persistent menu: 1,000 characters

    Request Example

    
    {
      "type": "location",
      "label": "Location"
    }