Design LINE Card Message (Template)
line_design_cardDesign LINE template messages (card messages) as JSON. Validates and enforces LINE limits for buttons, confirm, carousel, and image_carousel types.
Instructions
Build a validated LINE Template message (LINE OA Manager calls it a "Card Message") and return it as JSON to hand to line_send_message via message.message_json. DESIGN ONLY — never calls the LINE API.
kind (required) picks the subtype and enforces LINE limits:
buttons → title?, text, thumbnail_image_url?, actions (1..4 buttons; text ≤60 chars with title/thumb, else ≤160)
confirm → text + exactly 2 buttons (e.g. ตกลง / ยกเลิก)
carousel → columns (≤10, each ≤3 buttons); EVERY column must have the SAME number of buttons (LINE rule)
image_carousel → columns of { image_url (HTTPS), action } (≤10) Actions: uri | message | postback; label ≤20 chars. alt_text (1..400) required.
Returns { message, usage_hint }.
Example: "การ์ดยืนยันการจอง ตกลง/ยกเลิก" → { kind:"confirm", alt_text:"ยืนยันการจอง", text:"ยืนยันคิว 14:00 ไหม?", actions:[{type:"postback",label:"ตกลง",data:"confirm=1"},{type:"message",label:"ยกเลิก",text:"ยกเลิก"}] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | Card subtype. Determines which other fields are required. | |
| text | No | [buttons] body (≤60 with title/thumb, else ≤160). [confirm] question (required). | |
| title | No | [buttons] Optional card title. | |
| actions | No | [buttons] 1..4 buttons. [confirm] exactly 2 buttons. | |
| columns | No | [carousel] ≤10 columns (same action-count each). [image_carousel] ≤10 columns. | |
| alt_text | Yes | Fallback text shown in push notification + chat list (1..400 chars). | |
| thumbnail_image_url | No | [buttons] Optional HTTPS thumbnail. |