Skip to content

@line/bot-sdkDocs


@line/bot-sdk / PostbackAction

Type Alias: PostbackAction

PostbackAction: object

When a control associated with this action is tapped, a postback event is returned via webhook with the specified string in the data property.

Type declaration

data

data: string

String returned via webhook in the postback.data property of the postback event (Max: 300 characters)

displayText?

optional displayText: string

Text displayed in the chat as a message sent by the user when the action is performed.

  • Required for quick reply buttons.
  • Optional for the other message types.

Max: 300 characters

The displayText and text properties cannot both be used at the same time.

fillInText?

optional fillInText: string

String to be pre-filled in the input field when the keyboard is opened. Valid only when the inputOption property is set to openKeyboard. The string can be broken by a newline character (\n).

Max: 300 characters

inputOption?

optional inputOption: "closeRichMenu" | "openRichMenu" | "openKeyboard" | "openVoice"

The display method of such as rich menu based on user action. Specify one of the following values:

  • closeRichMenu: Close rich menu
  • openRichMenu: Open rich menu
  • openKeyboard: Open keyboard
  • openVoice: Open voice message input mode

This property is available on LINE version 12.6.0 or later for iOS or Android.

text?

optional text: string

Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook.

  • This property cannot be used with quick reply buttons. (Max: 300 characters)
  • The displayText and text properties cannot both be used at the same time.

Deprecated

type

type: "postback"

Defined in

lib/types.ts:2165