BOT API Trial
Sending Messages
• Text
• Image
• Video
• Audio
• Location
• Sticker
• Rich Message
BOT API Trial
Sending Messages
• Text
• Image
• Video
• Audio
• Location
• Sticker
• Rich Message
BOT API Trial
Sending Messages
• Text
• Image
• Video
• Audio
• Location
• Sticker
• Rich Message
BOT API Trial Problems
Complexity of features with rich UI/UX
Need to send message one-by-one in order to
receive response from users
Cannot join group
Etc…
API is complex
LINE BOT & Messaging API
New Message
API
Added new
MessageType
Events that
can be accepted
via webhook
Participation
in groups
New features added to LINE Bot
New Messaging API
New Messaging API
LINE Chat
(1-on-1 or group)
1. Reply API
LINE Server Bot Application
LINE
Message
Your System
Webhook
Reply ID
New Messaging API
LINE Chat
(1-on-1 or group)
1. Reply API
LINE Server Bot Application
LINE
Message
Your System
Webhook
Reply ID
Message Reply
With reply ID
New Messaging API
LINE Server
2. Push API
LINE Chat
(1-on-1 or group)
Bot Application
LINE
Message
Your System
Push
with
user ID /
group ID
BOT API Trial Message API
curl -X POST ¥
-H 'Content-Type: application/json' ¥
-H 'X-Line-ChannelID: <Channel ID>' ¥
-H 'X-Line-ChannelSecret: <Channel Secret>' ¥
-H 'X-Line-Trusted-User-With-ACL: <Channel MID>' ¥
-d '{
"to":["userId1"],
"toChannel":1383378250,
"eventType":"138311608800106203",
"content":{
"contentType":1,
"toType":1,
"text":"Hello, Jose!"
}
}’ https://trialbot-api.line.me/v1/events
BOT API Trial Message API
curl -X POST ¥
-H 'Content-Type: application/json' ¥
-H 'X-Line-ChannelID: <Channel ID>' ¥
-H 'X-Line-ChannelSecret: <Channel Secret>' ¥
-H 'X-Line-Trusted-User-With-ACL: <Channel MID>' ¥
-d '{
"to":["userId1"],
"toChannel":1383378250,
"eventType":"138311608800106203",
"content":{
"contentType":1,
"toType":1,
"text":"Hello, Jose!"
}
}’ https://trialbot-api.line.me/v1/events
Too many Bot Info
Fixed Magic Number
Unknown value
Fixed Magic Number
New Messaging API
curl -X POST ¥
-H "Content-Type:application/json" ¥
-H "Authorization: Bearer <Access Token>" ¥
-d '{
"to": "userId or groupId",
"messages": [
{"type": "text", "text": "Hello LINE Bot" }
]
} ' https://api.line.me/v2/bot/message/push
New Messaging Type
New Message Type
Buttons Template
{
"type": "template",
"altText": "this is an template",
"template": {
"type": buttons",
"thumbnailImageUrl":
"http://example.com/image.jpg",
"title": "Current Weather…",
"text": "9/29 Weather…",
"actions": [{
"type": "message",
"label": ”How about…",
"text": "How about…"
}, {
"type": "uri",
"label": ”Open Browser",
"uri": "https://line.me"
}]
}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": buttons",
"thumbnailImageUrl":
"http://example.com/image.jpg",
"title": "Current Weather…",
”text": "9/29 Weather…",
"actions": [{
"type": "message",
"label": ”How about…",
"text": "How about…"
}, {
"type": "uri",
"label": ”Open Browser",
"uri": "https://line.me"
}]
}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": buttons",
"thumbnailImageUrl":
"http://example.com/image.jpg",
"title": "Current Weather…",
"text": "9/29 Weather…",
"actions": [{
"type": "message",
"label": ”How about…",
"text": "How about…"
}, {
"type": "uri",
"label": ”Open Browser",
"uri": "https://line.me"
}]
}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": buttons",
"thumbnailImageUrl":
"http://example.com/image.jpg",
"title": "Current Weather…",
”text": "9/29 Weather…",
"actions": [{
"type": "message",
"label": ”How about…",
"text": "How about…"
}, {
"type": "uri",
"label": ”Open Browser",
"uri": "https://line.me"
}]
}
}
New Message Type
Confirm Template
{
"type": "template",
"altText": "this is an template",
"template": {
"type": “confirm”,
"text": "Are you sure?",
"actions": [{
"type": "message",
"label": "OK",
"text": "Yes, Please"
}, {
"type": "message",
"label": ”Cancel",
"text": "No thank you"
}]
}
}
New Message Type
Carousel Template
{
"type": "template",
"altText": "this is an template",
"template": {
"type": "carousel",
"columns": [{
"thumbnailImageUrl”:"http://…",
"title": "Current Whether…",
”text": "9/29 Whether…",
"actions": [ ... ]
}, {
"thumbnailImageUrl”: "http://…",
"title": "Current Whether…",
"text": "9/30 Whether…",
"actions": [ ... ]
}
]}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": "carousel",
"columns": [{
"thumbnailImageUrl”:"http://…",
"title": "Current Whether…",
”text": "9/29 Whether…",
"actions": [ ... ]
}, {
"thumbnailImageUrl”: "http://…",
"title": "Current Whether…",
"text": "9/30 Whether…",
"actions": [ ... ]
}
]}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": "carousel",
"columns": [{
"thumbnailImageUrl”:"http://…",
"title": "Current Whether…",
”text": "9/29 Whether…",
"actions": [ ... ]
}, {
"thumbnailImageUrl”: "http://…",
"title": "Current Whether…",
"text": "9/30 Whether…",
"actions": [ ... ]
}
]}
}
{
"type": "template",
"altText": "this is an template",
"template": {
"type": "carousel",
"columns": [{
"thumbnailImageUrl”:"http://…",
"title": "Current Whether…",
”text": "9/29 Whether…",
"actions": [ ... ]
}, {
"thumbnailImageUrl”: "http://…",
"title": "Current Whether…",
"text": "9/30 Whether…",
"actions": [ ... ]
}
]}
}
Now’s the Time to Begin Coding!!
Webhook
LINE Chat
(1-on-1 or group)
LINE Server Bot Application
LINE
Message
Your System
Webhook
LINE Chat
(1-on-1 or group)
Event
{ "events": […] }
event
contact status
“follow” “unfollow”“message”
• Text
• Image
• Location
• Sticker
• Contact
event
contact status
“follow” “unfollow”
group status
“join” “leave”
“beacon” “postback”
“message”
• Text
• Image
• Location
• Sticker
• Contact
Postback?
Send Event to Your Server Directly with Parameters.
{
"replyToken": “xxxxxxxxxx",
"type": "postback",
"timestamp": 1462629479859,
"source": {
"type": "user",
"userId": "xxxxxxxxxxxx"
},
"postback": {
"data": "action=remind&itemId=123",
}
}
Bot Application
Webhook
Let’s Implement Bot Server!!
Summary
New Message
API
Added new
Message Type
Events that
can be accepted
via webhook
Participation
in groups
New features added to Messaging API
B 3 line bot live coding

B 3 line bot live coding

  • 3.
    BOT API Trial SendingMessages • Text • Image • Video • Audio • Location • Sticker • Rich Message
  • 4.
    BOT API Trial SendingMessages • Text • Image • Video • Audio • Location • Sticker • Rich Message
  • 5.
    BOT API Trial SendingMessages • Text • Image • Video • Audio • Location • Sticker • Rich Message
  • 6.
    BOT API TrialProblems Complexity of features with rich UI/UX Need to send message one-by-one in order to receive response from users Cannot join group Etc… API is complex
  • 8.
    LINE BOT &Messaging API New Message API Added new MessageType Events that can be accepted via webhook Participation in groups New features added to LINE Bot
  • 9.
  • 10.
    New Messaging API LINEChat (1-on-1 or group) 1. Reply API LINE Server Bot Application LINE Message Your System Webhook Reply ID
  • 11.
    New Messaging API LINEChat (1-on-1 or group) 1. Reply API LINE Server Bot Application LINE Message Your System Webhook Reply ID Message Reply With reply ID
  • 12.
    New Messaging API LINEServer 2. Push API LINE Chat (1-on-1 or group) Bot Application LINE Message Your System Push with user ID / group ID
  • 13.
    BOT API TrialMessage API curl -X POST ¥ -H 'Content-Type: application/json' ¥ -H 'X-Line-ChannelID: <Channel ID>' ¥ -H 'X-Line-ChannelSecret: <Channel Secret>' ¥ -H 'X-Line-Trusted-User-With-ACL: <Channel MID>' ¥ -d '{ "to":["userId1"], "toChannel":1383378250, "eventType":"138311608800106203", "content":{ "contentType":1, "toType":1, "text":"Hello, Jose!" } }’ https://trialbot-api.line.me/v1/events
  • 14.
    BOT API TrialMessage API curl -X POST ¥ -H 'Content-Type: application/json' ¥ -H 'X-Line-ChannelID: <Channel ID>' ¥ -H 'X-Line-ChannelSecret: <Channel Secret>' ¥ -H 'X-Line-Trusted-User-With-ACL: <Channel MID>' ¥ -d '{ "to":["userId1"], "toChannel":1383378250, "eventType":"138311608800106203", "content":{ "contentType":1, "toType":1, "text":"Hello, Jose!" } }’ https://trialbot-api.line.me/v1/events Too many Bot Info Fixed Magic Number Unknown value Fixed Magic Number
  • 15.
    New Messaging API curl-X POST ¥ -H "Content-Type:application/json" ¥ -H "Authorization: Bearer <Access Token>" ¥ -d '{ "to": "userId or groupId", "messages": [ {"type": "text", "text": "Hello LINE Bot" } ] } ' https://api.line.me/v2/bot/message/push
  • 16.
  • 17.
  • 18.
    { "type": "template", "altText": "thisis an template", "template": { "type": buttons", "thumbnailImageUrl": "http://example.com/image.jpg", "title": "Current Weather…", "text": "9/29 Weather…", "actions": [{ "type": "message", "label": ”How about…", "text": "How about…" }, { "type": "uri", "label": ”Open Browser", "uri": "https://line.me" }] } }
  • 19.
    { "type": "template", "altText": "thisis an template", "template": { "type": buttons", "thumbnailImageUrl": "http://example.com/image.jpg", "title": "Current Weather…", ”text": "9/29 Weather…", "actions": [{ "type": "message", "label": ”How about…", "text": "How about…" }, { "type": "uri", "label": ”Open Browser", "uri": "https://line.me" }] } }
  • 20.
    { "type": "template", "altText": "thisis an template", "template": { "type": buttons", "thumbnailImageUrl": "http://example.com/image.jpg", "title": "Current Weather…", "text": "9/29 Weather…", "actions": [{ "type": "message", "label": ”How about…", "text": "How about…" }, { "type": "uri", "label": ”Open Browser", "uri": "https://line.me" }] } }
  • 21.
    { "type": "template", "altText": "thisis an template", "template": { "type": buttons", "thumbnailImageUrl": "http://example.com/image.jpg", "title": "Current Weather…", ”text": "9/29 Weather…", "actions": [{ "type": "message", "label": ”How about…", "text": "How about…" }, { "type": "uri", "label": ”Open Browser", "uri": "https://line.me" }] } }
  • 22.
  • 23.
    { "type": "template", "altText": "thisis an template", "template": { "type": “confirm”, "text": "Are you sure?", "actions": [{ "type": "message", "label": "OK", "text": "Yes, Please" }, { "type": "message", "label": ”Cancel", "text": "No thank you" }] } }
  • 24.
  • 25.
    { "type": "template", "altText": "thisis an template", "template": { "type": "carousel", "columns": [{ "thumbnailImageUrl”:"http://…", "title": "Current Whether…", ”text": "9/29 Whether…", "actions": [ ... ] }, { "thumbnailImageUrl”: "http://…", "title": "Current Whether…", "text": "9/30 Whether…", "actions": [ ... ] } ]} }
  • 26.
    { "type": "template", "altText": "thisis an template", "template": { "type": "carousel", "columns": [{ "thumbnailImageUrl”:"http://…", "title": "Current Whether…", ”text": "9/29 Whether…", "actions": [ ... ] }, { "thumbnailImageUrl”: "http://…", "title": "Current Whether…", "text": "9/30 Whether…", "actions": [ ... ] } ]} }
  • 27.
    { "type": "template", "altText": "thisis an template", "template": { "type": "carousel", "columns": [{ "thumbnailImageUrl”:"http://…", "title": "Current Whether…", ”text": "9/29 Whether…", "actions": [ ... ] }, { "thumbnailImageUrl”: "http://…", "title": "Current Whether…", "text": "9/30 Whether…", "actions": [ ... ] } ]} }
  • 28.
    { "type": "template", "altText": "thisis an template", "template": { "type": "carousel", "columns": [{ "thumbnailImageUrl”:"http://…", "title": "Current Whether…", ”text": "9/29 Whether…", "actions": [ ... ] }, { "thumbnailImageUrl”: "http://…", "title": "Current Whether…", "text": "9/30 Whether…", "actions": [ ... ] } ]} }
  • 29.
    Now’s the Timeto Begin Coding!!
  • 31.
    Webhook LINE Chat (1-on-1 orgroup) LINE Server Bot Application LINE Message Your System Webhook LINE Chat (1-on-1 or group) Event { "events": […] }
  • 32.
    event contact status “follow” “unfollow”“message” •Text • Image • Location • Sticker • Contact
  • 33.
    event contact status “follow” “unfollow” groupstatus “join” “leave” “beacon” “postback” “message” • Text • Image • Location • Sticker • Contact
  • 34.
    Postback? Send Event toYour Server Directly with Parameters. { "replyToken": “xxxxxxxxxx", "type": "postback", "timestamp": 1462629479859, "source": { "type": "user", "userId": "xxxxxxxxxxxx" }, "postback": { "data": "action=remind&itemId=123", } } Bot Application Webhook
  • 35.
  • 38.
    Summary New Message API Added new MessageType Events that can be accepted via webhook Participation in groups New features added to Messaging API