class Line::Message::Builder::Actions::Postback

Represents a postback action for LINE messages.

A postback action sends a postback event to your bot’s webhook when a button associated with this action is tapped. The event contains the specified data payload. Optionally, display_text can be provided, which will be shown in the chat as a message from the user.

This action is useful for triggering specific backend logic or flows without necessarily displaying a message in the chat, or for displaying a different message than the data payload.

Example

Line::Message::Builder.with do
  text "What do you want to do?"
  quick_reply do
    button action: :postback,
           label: "Track Order",
           data: "action=track_order&order_id=123",
           display_text: "I want to track my order."
  end
end

See also: