Loading...
Loading...
Comprehensive reference for LINE Messaging API — webhook setup, message sending, Flex Message design, Rich Menu management, audience targeting, insights, coupons, and channel access tokens. This skill should be used when the user asks to "build a LINE Bot", "set up a webhook", "send a push message", "design a Flex Message", "create a Rich Menu", "manage audience targeting", "get messaging insights", "create a coupon campaign", "debug webhook signature verification", or mentions LINE Messaging API, LINE OA chatbot, reply/push/multicast/narrowcast/broadcast, Flex Message JSON, Rich Menu, group chat bot, channel access token, or URL schemes. Always use this skill whenever the user mentions LINE bots, chatbots, LINE OA, or any messaging-related LINE integration, even if they don't explicitly say "Messaging API".
npx skill4agent add abgne/line-dev messaging-apiLINE_CHANNEL_ACCESS_TOKEN=Bot access token
LINE_CHANNEL_SECRET=Channel secret (webhook signature verification)x-line-signature{"destination": "U...", "events": [...]}200channel_secret = ENV['LINE_CHANNEL_SECRET']
signature = request.headers['x-line-signature']
body = request.body # raw bytes, do NOT parse/reformat before verification
digest = HMAC_SHA256(key = channel_secret, message = body)
expected = Base64.encode(digest)
if signature != expected:
return 403 # reject — not from LINE
events = JSON.parse(body)['events']
for event in events:
handle(event)
return 200Authorization: Bearer {channel access token}| Mode | Endpoint | Purpose |
|---|---|---|
| Reply | | Reply to user (requires one-time replyToken) |
| Push | | Send to a specific user/group at any time |
| Multicast | | Send to multiple users (max 500) |
| Broadcast | | Send to all friends |
api.line.meapi-data.line.meContainer (Bubble / Carousel)
└── Block (Header / Hero / Body / Footer)
└── Component (Box / Button / Image / Video / Icon / Text / Span / Separator){
"type": "flex", "altText": "Notification",
"contents": {
"type": "bubble",
"body": {
"type": "box", "layout": "vertical",
"contents": [{"type": "text", "text": "Hello Flex!", "weight": "bold"}]
}
}
}assets/examples/| File | Topic |
|---|---|
| references/api-common.md | Read first. Rate limits, error handling, forward compatibility |
| references/webhook-events.md | Webhook event types and JSON structure |
| references/message-objects.md | Message objects, Quick Reply, sender customization |
| references/action-objects.md | Action objects (postback, URI, datetimepicker, etc.) |
| references/message-sending.md | Reply/Push/Multicast/Narrowcast/Broadcast, statistics |
| references/flex-message.md | Flex Message components, layout, styles |
| references/rich-menu.md | Rich Menu CRUD, tab switching, display priority |
| references/user.md | User profile, follower IDs, account link |
| references/group-chat.md | Group/Room messaging and member APIs |
| references/audience.md | Audience management (create/add/get/delete) |
| references/insights.md | Delivery, follower, and interaction insights |
| references/channel-token.md | Channel access token lifecycle |
| references/coupon.md | Coupon CRUD, reward types, sending |
| references/url-schemes.md | LINE URL schemes for deep linking |
| references/experts.md | Expert domain routing and 17 specialist profiles |
| assets/examples/ | Flex Message JSON examples (11 showcases) |