6. Messaging API 설정 및 시작하기
https://developers.line.me/messaging-api/getting-started
7. Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
8. Messaging API 기능
• Webhooks
봇 서버가 사용자의 이벤트를 수신
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
9. Webhooks
① 봇이 존재하는 채팅방에서 이벤트가 발생한다.
② Webhooks을 통해 Webhooks URL로 등록된 봇 서버로 이벤
트를 HTTPS POST request 방식으로 수신한다.
③ 수신된 이벤트를 봇 서버에서 처리한다.
④ 처리된 결과물을 이벤트가 발생된 채팅방으로 전송한다.
12. ① “replyToken”
사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
event타입
③ “timestamp”
④ “source”
a. “type”
사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
채팅방의 식별자
⑤ “message” (message event)
a. “id”
메세지 식별자
b. ”type”
메세지 종류
c. “text”
메세지 내용
13. ① “replyToken”
사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
event타입
③ “timestamp”
④ “source”
a. “type”
사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
채팅방의 식별자
⑤ “message” (message event)
a. “id”
메세지 식별자
b. ”type”
메세지 종류
c. “text”
메세지 내용
15. ① “replyToken”
사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
event타입
message, follow, unfollow, join, leave, postback
③ “timestamp”
④ “source”
a. “type”
사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
채팅방의 식별자
⑤ “message” (message event)
a. “id”
메세지 식별자
b. ”type”
메세지 종류
c. “text”
메세지 내용
LINE서버로부터 봇 서버로 전달되는 이벤트(JSON)
16. ① “replyToken”
사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
event타입
message, follow, unfollow, join, leave, postback
③ “timestamp”
④ “source”
a. “type”
사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
채팅방의 식별자
⑤ “message” (message event)
a. “id”
메세지 식별자
b. ”type”
메세지 종류
c. “text”
메세지 내용
18. ① “user”
봇과 사용자간의 1:1대화
“type” : “user”
”userId” : “xxxxxxxxx”
② ”group”
그룹내에서 그룹원과 봇과의 대화
“type” : “group”
“groupID” : “xxxxxxxxx“
③ “room”
룸안에서 룸 구성원과 봇과의 대화
“type” : “room”
“roomID” : “xxxxxxx”
userID의 경우 user의 식별자
그룹과 룸내의 구성원 개인 userID는 알 수 없음
19. Messaging API 기능
• Webhooks
• Push Message API
봇이 사용자에게 보내는 이벤트
• Reply Message API
사용자와 봇이 서로 소통하는 기능
• Get Contents API
• Get Profile API
• Leave API
21. ① “replyToken”
사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
event타입
message, follow, unfollow, join, leave, postback
③ “timestamp”
④ “source”
a. “type”
사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
채팅방의 식별자
⑤ “message” (message event)
a. “id”
메세지 식별자
b. ”type”
메세지 종류
c. “text”
메세지 내용
LINE서버로부터 봇 서버로 전달되는 이벤트(JSON)
23. Send message object
• Text : 최대 2000자까지
• Image : 최대 1024x1024, 1MB (JPEG)
• Video : 최대 1분이하, 10MB (mp4)
• Audio : 최대 1분이하, 10MB (m4a)
• Location : 위도와 경도 + title, address 최대 100자까지
• Sticker : sticker list - https://devdocs.line.me/files/sticker_list.pdf
• Imagemap
• template
URL링크는 최대 1000자까지
37. Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
사용자로부터 전송된 image, video, and audio 컨텐츠를 검색하는 API
• Get Profile API
• Leave API
39. Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
사용자의 Profile을 가져오는 API
• Leave API
41. Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
• 봇이 그룹이나 룸을 떠나게 하는 API
43. Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
+LINE Beacon
44. LINE Beacon
• LINE 사용자가 LINE Beacon에 접근하여 LINE bot이 Webhooks
을 통해 알림을 받았을 때 특정 서비스를 제공하도록 하는 기능
• 2016년 9월 이후 특정 회사나 개인사업자에게만 출시된 상태이
며, 추후에 보편화할 계획
• 하나의 계정은 하나의 비콘에만 연결 될 수있음
45. Reference
• Messaging API intro
https://business.line.me/ko/companies/1236120/services/bot
• Messaging API documents
https://developers.line.me/messaging-api/overview
• Messaging API Reference
https://devdocs.line.me/en/?java#messaging-api
• Line-messaging(Node.js)
https://www.npmjs.com/package/line-messaging
• Imagemap 그림 참고
http://www.slideshare.net/flashscope/line-bot-api-trial