SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
LINE Bot
(Messaging API)
최성식
Messaging API?
LINE에서 제공하는 Bot개발용 API
*기존 BOT API Trial Account서비스는 2016년 11월 16일부로 종료
Messaging API 구조
Messaging API는 LINE Server를 통해 데이터를 (봇)서버와 LINE 앱 사이에 릴레이하는 방식으로 작동하며
요청은 JSON 형식의 API를 통해 전송됩니다.
Messaging API 플랜
Messaging API SDK
+ Node.js : line-messaging(unofficial)
Messaging API 설정 및 시작하기
https://developers.line.me/messaging-api/getting-started
Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
Messaging API 기능
• Webhooks
봇 서버가 사용자의 이벤트를 수신
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
Webhooks
① 봇이 존재하는 채팅방에서 이벤트가 발생한다.
② Webhooks을 통해 Webhooks URL로 등록된 봇 서버로 이벤
트를 HTTPS POST request 방식으로 수신한다.
③ 수신된 이벤트를 봇 서버에서 처리한다.
④ 처리된 결과물을 이벤트가 발생된 채팅방으로 전송한다.
LINE서버로부터 봇 서버로
전달되는 이벤트(JSON)
Linebot
① “replyToken”
 사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
 event타입
③ “timestamp”
④ “source”
a. “type”
 사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
 채팅방의 식별자
⑤ “message” (message event)
a. “id”
 메세지 식별자
b. ”type”
 메세지 종류
c. “text”
 메세지 내용
① “replyToken”
 사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
 event타입
③ “timestamp”
④ “source”
a. “type”
 사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
 채팅방의 식별자
⑤ “message” (message event)
a. “id”
 메세지 식별자
b. ”type”
 메세지 종류
c. “text”
 메세지 내용
+Beacon event
① “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)
① “replyToken”
 사용자가 봇에게 메세지를 보내고, 봇이 그에 응
답할 때 필요한 토큰
② “type”
 event타입
 message, follow, unfollow, join, leave, postback
③ “timestamp”
④ “source”
a. “type”
 사용자가 봇에게 메세지를 보내는 채팅방의
유형
b. “xxxxID”
 채팅방의 식별자
⑤ “message” (message event)
a. “id”
 메세지 식별자
b. ”type”
 메세지 종류
c. “text”
 메세지 내용
Group
User
Room
① “user”
봇과 사용자간의 1:1대화
“type” : “user”
”userId” : “xxxxxxxxx”
② ”group”
그룹내에서 그룹원과 봇과의 대화
“type” : “group”
“groupID” : “xxxxxxxxx“
③ “room”
룸안에서 룸 구성원과 봇과의 대화
“type” : “room”
“roomID” : “xxxxxxx”
 userID의 경우 user의 식별자
 그룹과 룸내의 구성원 개인 userID는 알 수 없음
Messaging API 기능
• Webhooks
• Push Message API
 봇이 사용자에게 보내는 이벤트
• Reply Message API
사용자와 봇이 서로 소통하는 기능
• Get Contents API
• Get Profile API
• Leave API
Linebot
① “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)
Linebot
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자까지
Send message object
Imagemap
Linebot
Linebot
Linebot
Linebot
Send message object
template
Linebot
Linebot
Linebot
Linebot
Linebot
Linebot
Linebot
Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
사용자로부터 전송된 image, video, and audio 컨텐츠를 검색하는 API
• Get Profile API
• Leave API
Linebot
Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
사용자의 Profile을 가져오는 API
• Leave API
Get Profile API
Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
• 봇이 그룹이나 룸을 떠나게 하는 API
Linebot
Messaging API 기능
• Webhooks
• Push Message API
• Reply Message API
• Get Contents API
• Get Profile API
• Leave API
+LINE Beacon
LINE Beacon
• LINE 사용자가 LINE Beacon에 접근하여 LINE bot이 Webhooks
을 통해 알림을 받았을 때 특정 서비스를 제공하도록 하는 기능
• 2016년 9월 이후 특정 회사나 개인사업자에게만 출시된 상태이
며, 추후에 보편화할 계획
• 하나의 계정은 하나의 비콘에만 연결 될 수있음
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
Q & A

Weitere ähnliche Inhalte

Andere mochten auch

000001560595_1425351208416_0.5687465614331808
000001560595_1425351208416_0.5687465614331808000001560595_1425351208416_0.5687465614331808
000001560595_1425351208416_0.5687465614331808GeniNetworks
 
리눅스를 이용한 Nas만들기
리눅스를 이용한 Nas만들기리눅스를 이용한 Nas만들기
리눅스를 이용한 Nas만들기SeongSik Choi
 
Firebase Database 둘러보기
Firebase Database 둘러보기Firebase Database 둘러보기
Firebase Database 둘러보기SeongSik Choi
 
000001871277_1425351249536_0.35266743797617006
000001871277_1425351249536_0.35266743797617006000001871277_1425351249536_0.35266743797617006
000001871277_1425351249536_0.35266743797617006GeniNetworks
 

Andere mochten auch (11)

Din9talk(beta0.3.1)
Din9talk(beta0.3.1)Din9talk(beta0.3.1)
Din9talk(beta0.3.1)
 
Din9talk(beta0.2.0)
Din9talk(beta0.2.0)Din9talk(beta0.2.0)
Din9talk(beta0.2.0)
 
GCM demo on Android
GCM demo on AndroidGCM demo on Android
GCM demo on Android
 
000001560595_1425351208416_0.5687465614331808
000001560595_1425351208416_0.5687465614331808000001560595_1425351208416_0.5687465614331808
000001560595_1425351208416_0.5687465614331808
 
FCM알아보기
FCM알아보기FCM알아보기
FCM알아보기
 
리눅스를 이용한 Nas만들기
리눅스를 이용한 Nas만들기리눅스를 이용한 Nas만들기
리눅스를 이용한 Nas만들기
 
RokSeoul
RokSeoulRokSeoul
RokSeoul
 
Firebase Database 둘러보기
Firebase Database 둘러보기Firebase Database 둘러보기
Firebase Database 둘러보기
 
000001871277_1425351249536_0.35266743797617006
000001871277_1425351249536_0.35266743797617006000001871277_1425351249536_0.35266743797617006
000001871277_1425351249536_0.35266743797617006
 
HTTPS, 원격제어
HTTPS, 원격제어HTTPS, 원격제어
HTTPS, 원격제어
 
AR tool - Vuforia
AR tool - VuforiaAR tool - Vuforia
AR tool - Vuforia
 

Ähnlich wie Linebot

루비온레일즈로 카카오톡 봇 만들기
루비온레일즈로 카카오톡 봇 만들기루비온레일즈로 카카오톡 봇 만들기
루비온레일즈로 카카오톡 봇 만들기Junghyun Park
 
.NET에서 Twitter 프로그래밍
.NET에서 Twitter 프로그래밍.NET에서 Twitter 프로그래밍
.NET에서 Twitter 프로그래밍흥배 최
 
[OpenTRS-001] election_coin
[OpenTRS-001] election_coin[OpenTRS-001] election_coin
[OpenTRS-001] election_coinTheori
 
모바일 메신저 아키텍쳐 소개
모바일 메신저 아키텍쳐 소개모바일 메신저 아키텍쳐 소개
모바일 메신저 아키텍쳐 소개Hyogi Jung
 
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API 안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API Gosu Ok
 

Ähnlich wie Linebot (6)

루비온레일즈로 카카오톡 봇 만들기
루비온레일즈로 카카오톡 봇 만들기루비온레일즈로 카카오톡 봇 만들기
루비온레일즈로 카카오톡 봇 만들기
 
.NET에서 Twitter 프로그래밍
.NET에서 Twitter 프로그래밍.NET에서 Twitter 프로그래밍
.NET에서 Twitter 프로그래밍
 
[OpenTRS-001] election_coin
[OpenTRS-001] election_coin[OpenTRS-001] election_coin
[OpenTRS-001] election_coin
 
Slackbot with Python
Slackbot with PythonSlackbot with Python
Slackbot with Python
 
모바일 메신저 아키텍쳐 소개
모바일 메신저 아키텍쳐 소개모바일 메신저 아키텍쳐 소개
모바일 메신저 아키텍쳐 소개
 
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API 안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
안드로이드 OAuth 1.0a, 2.0 구현 - Naver, Google API
 

Linebot

  • 2. Messaging API? LINE에서 제공하는 Bot개발용 API *기존 BOT API Trial Account서비스는 2016년 11월 16일부로 종료
  • 3. Messaging API 구조 Messaging API는 LINE Server를 통해 데이터를 (봇)서버와 LINE 앱 사이에 릴레이하는 방식으로 작동하며 요청은 JSON 형식의 API를 통해 전송됩니다.
  • 5. Messaging API SDK + Node.js : line-messaging(unofficial)
  • 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
  • 46. Q & A

Hinweis der Redaktion

  1. Messaging API는 LINE Server를 통해 데이터를 서버와 LINE 앱 사이에 릴레이하는 방식으로 작동하며 요청은 JSON 형식의 API를 통해 전송됩니다.
  2. Messaging API는 LINE Server를 통해 데이터를 서버와 LINE 앱 사이에 릴레이하는 방식으로 작동하며 요청은 JSON 형식의 API를 통해 전송됩니다.
  3. Unfollow event 봇이 차단당했을 때