An action object defines an action of the bot when a button in a message or menu is pressed.
The available action types are as follows:
The available positions for each action type are as follows:
| Action type | Available positions |
|---|---|
| Postback action | Carousel Image Carousel Quick Reply Rich Menu |
| Message action | Button Template List Template Carousel Image Carousel Quick Reply Persistent Menu Rich Menu |
| URI action | Button Template List Template Carousel Image Carousel Quick Reply Persistent Menu Rich Menu |
| Camera action | Quick Reply |
| Camera roll action | Quick Reply |
| Location action | Quick Reply |
| Copy action | Button Template List Template Carousel Image Carousel Quick Reply Persistent Menu Rich Menu |
When an element associated with this action is pressed, a Postback Event containing the text string specified in the data parameter is returned through the callback.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "postback". |
| label | string | See the 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 maximum length: 20 characters • Maximum length for an image carousel: 12 characters |
| data | string | Y | Text string returned through the callback of the postback.data property. Maximum length: 300 characters |
| displayText | string | See the description. | Chat message sent by a user. If it is not specified, no text is displayed. Note that it is required for a quick reply. Maximum length: 300 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters |
| i18nDisplayTexts | array | N | List of multilingual display texts |
| 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. Maximum length: 300 characters |
{ "type": "postback", "label": "Buy", "data": "action=buy&itemid=111", "displayText": "Buy"When an element associated with this action is pressed, a text string is sent as a message and a Message Event is returned through the callback.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "message". |
| label | string | See the 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 maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for persistent menu: 1,000 characters |
| Text | string | See the description. | Text message sent when an element is pressed. It is required for a carousel, image carousel, rich menu and quick reply, and replaced with the label value for a button template, list template and persistent menu. Maximum length: 300 characters |
| postback | string | N | Text string returned through the message.postback property Maximum length: 1,000 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
| i18nTexts | array | N | List of multilingual texts |
| i18nTexts[].language | string | Y | Language code • ko_KR • ja_JP • zh_CN • zh_TW • en_US |
| i18nTexts[].text | string | Y | Text message sent when an element is pressed. It is required for a carousel, image carousel, rich menu and quick reply, and replaced with the label value for a button template, list template and persistent menu. Maximum length: 300 characters |
{ "type": "message", "label": "Yes", "text": "Yes"}When an element associated with this action is pressed, the URI set in the uri property opens.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "uri". |
| label | string | See the 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 maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
| uri | string | Y | URI that opens when an element is pressed. The "http" and "https" schemas are supported. Maximum length: 1,000 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
{ "type": "uri", "label": "View details", "uri": "http://example.com"}When a button associated with this action is pressed, the camera screen opens.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
- It is available only on mobile.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "camera". |
| label | string | Y | Button label Maximum length: 20 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
{ "type": "camera", "label": "Camera"}When a button associated with this action is pressed, the camera roll opens.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
- It is available only on mobile.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "cameraRoll". |
| label | string | Y | Button label Maximum length: 20 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
{ "type": "cameraRoll", "label": "Camera roll"}When a button associated with this action is pressed, the location information screen opens.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
- It is available only on mobile.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "location". |
| label | string | Y | Button label Maximum length: 20 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
{ "type": "location", "label": "Location"}When a button associated with this action is pressed, the text specified in the copyText parameter is copied to the clipboard.
Note
- The available positions are limited for each action type. For more information, see the table in Action types .
Caution
- This action is available in v3.6 or later.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Y | Set this parameter to "copy". |
| label | string | See the 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 maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
| copyText | string | Y | Text string copied to the clipboard when an element is pressed. Maximum length: 1,000 characters |
| 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 an element. • Default maximum length: 20 characters • Maximum length for an image carousel: 12 characters • Maximum length for a persistent menu: 1,000 characters |
{"type": "copy","label": "Copy This","copyText": "This is a copied text."}