Momsg (webhook)

MO 메시지 이벤트를 중계사로 전달한다.

post

등록된 양방향 서비스를 사용하는 챗봇의 moMsgWebhookUrl 를 RBC 가 MaaP FE 로 전달하고, MaaP FE 는 전달받은 moMsgWebhookUrl 의 마지막 부분에 각 통신사 구분자URL {SKT|KT|LGU} 을 추가하여 이벤트를 전달된다. 예> RBC 가 MaaP FE 로 전달한 moMsgWebhookUrl 이 http://clientservice/momsg 인 경우, KT MaaP FE 는 http://clientservice/momsg/KT 로 전달. 규격은 array 형태이나, 실제 통신사 Maap FE 는 단건(1건) 단위로 전송한다.

Authorizations
Bodyobject[]
replyIdstring · max: 40Required

F/E 에서 제공하는 고유 id 로 이후에 중계사가 세션 메시지를 발송하려면 이 값을 /message API의 replyId로 포함해야 함. replyId는 24시간 유효함.

eventTypestring · enumRequired
  • FNW.11 스펙 2.15 - WebhookPayload 참고 (https://www.gsma.com/futurenetworks/wp-content/uploads/2017/11/FNW.11_v1.0.pdf)
  • MoMsgInfo 웹훅에 포함하는 이벤트 타입은 아래 3종류임.
    • message:유저가 직접 작성한 메시지 (text, file, userLocation message)
    • response:(persistent menu 혹은 메시지의 reply 버튼, chip list 의 reply 누를 때)
    • newUser:대화방 최초 진입 후 단말에서 자동 발신되는 메시지
Possible values:
postbackIdstring · max: 40Optional

response 이벤트 only - 대화방메뉴내 reply 클릭 시에, 속성으로 포함된 postbackId 값을 전달

postbackDataobjectOptional

newUser, response 이벤트 only - 칩리스트/리치카드 버튼 중 reply 클릭 시에, 발송 요청시 포함되었던 postbackData 값을 그대로 전달

displayTextstring · max: 100Optional

response - 발송 요청시 포함되었던 버튼의 텍스트를 그대로 전달, newUser 인 경우 '안녕'

messageBodyobjectOptional

message 이벤트 only

  • 텍스트 메시지의 경우: {"textMessage": "hello world"}
  • 파일 메시지의 경우: {"fileMessage":{"fileUrl": "https://maap-example.com/file.jpeg","fileMIMEType": "image/jpeg"}}
  • userLocation 메시지의 경우: {"geolocationPushMessage": {"label": "meeting location","timestamp": "2021-08-10T09:19:44Z","timeOffset": -540,"pos": "37.3587121 127.1151084","radius": 0}}
userContactstring · max: 40Required

유저 번호

chatbotIdstring · max: 40Required

대화방 chatbotId

timestampstring · date-timeRequired

응답한 시간

Responses
200
아래 예는 4가지 케이스에 대한 예시이다. * A: 유저가 직접 입력한 메시지 발송 * B: 대화방메뉴 중 reply 눌렀을 때 * C: 칩리스트/리치카드 버튼 중 reply 눌렀을 때 * D: 유저가 딥링크 등을 통해 신규로 대화방 진입하여 단말에서 자동으로 메시지 발송
post
POST /ag/1.2/momsg (webhook) HTTP/1.1
Host: maapdomain.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 726

[
  {
    "replyId": "A",
    "eventType": "message",
    "messageBody": {
      "textMessage": "hello world"
    },
    "userContact": "01012341234",
    "chatbotId": "bot_1",
    "timestamp": "2019-08-19T04:43:55.867+09"
  },
  {
    "replyId": "B",
    "eventType": "response",
    "postbackId": "pid_1",
    "displayText": "대화방메뉴 버튼 텍스트",
    "userContact": "01012341234",
    "chatbotId": "bot_1",
    "timestamp": "2019-08-19T04:43:55.867+09"
  },
  {
    "replyId": "C",
    "eventType": "response",
    "postbackData": "발송 시 지정한 값",
    "displayText": "칩리스트 버튼",
    "userContact": "01012341234",
    "chatbotId": "bot_1",
    "timestamp": "2019-08-19T04:43:55.867+09"
  },
  {
    "replyId": "D",
    "eventType": "newUser",
    "displayText": "안녕",
    "userContact": "01012341234",
    "chatbotId": "bot_1",
    "timestamp": "2019-08-19T04:43:55.867+09"
  }
]

No content