Contenu connexe Similaire à B 3 line bot live coding Similaire à B 3 line bot live coding (20) Plus de LINE Corporation (20) B 3 line bot live coding6. 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
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
10. New Messaging API
LINE Chat
(1-on-1 or group)
1. Reply API
LINE Server Bot Application
LINE
Message
Your System
Webhook
Reply ID
11. 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
12. 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
13. 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
14. 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
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
18. {
"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"
}]
}
}
19. {
"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"
}]
}
}
20. {
"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"
}]
}
}
21. {
"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"
}]
}
}
23. {
"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"
}]
}
}
25. {
"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": [ ... ]
}
]}
}
26. {
"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": [ ... ]
}
]}
}
27. {
"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": [ ... ]
}
]}
}
28. {
"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": [ ... ]
}
]}
}
31. 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": […] }
34. 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