Message
编辑于: 2023-11-09 11:59
TABLE OF CONTENTS
概述
Message API提供用户在渠道向您的PMS发送信息的能力。此接口是可选开发接口。
1. SendMessage:从渠道向您的PMS发送一条新消息。
Send Message
此API用户向您的PMS发送一条来自于渠道的信息
POST https://{your pms endpoint}/message/send HTTP/1.1 Authorization: Bearer 53ac07777cdffac2d53000002d698728ce964432d7167596bc005c5fc Accept-Encoding: gzip Content-Encoding: gzip Content-Type: application/json;charset=utf-8
请求
字段 | 类型 | 是否必填 | 描述 | 备注 |
---|---|---|---|---|
hotelId | String | 是 | 酒店在PMS中的唯一编号 |
|
distributorId | String | 是 | 渠道ID | |
thread | Object[Thread] | 是 |
|
|
thread/threadId | String | 是 |
|
|
thread/businessType | Enum
| 是 |
| 仅支持RESERVATION |
thread/message | Object[Message] | 是 |
|
|
thread/message/messageId | String | 是 |
|
|
thread/message/messageType | Enum
| 是 |
|
|
thread/message/message | String | 否 | message文本信息 |
|
thread/message/translatedMessage | String | 否 |
|
|
thread/message/imageUrl | String | 否 | 图片地址 |
|
thread/message/createdTime | String | 是 | yyyy-MM-dd'T'HH:mm:ss'Z' |
|
thread/message/extensions | Map<String:Object> | 否 | 扩展字段,不同渠道传递内容请参考实例 |
|
thread/reservation | Object[ReservationDetail] | 否 |
|
|
thread/reservation/distributorResId | String | 否 | 渠道订单号. |
|
thread/reservation/checkIn | String | 否 | yyyy-MM-dd |
|
thread/reservation/checkOut | String | 否 | yyyy-MM-dd |
|
thread/reservation/totalAmount | String | 否 | 总价 |
|
thread/reservation/adultCount | String | 否 | 成人数 |
|
thread/reservation/childCount | String | 否 | 儿童数 |
|
thread/reservation/roomId | String | 否 | PMS 房型ID |
|
thread/reservation/rateId | String | 否 | PMS 价格计划ID |
|
thread/reservation/extensions | Map<String:Object> | 否 | 扩展字段,不同渠道传递内容请参考实例 |
|
thread/extensions | Map<String:Object> | 否 | 扩展字段,不同渠道传递内容请参考实例 |
|
要求10秒内通过HTTP 200响应来确认收到通知。如果没有收到这样的响应,则认为通知失败。 确认成功收到通知的响应如下:
示例 - 来自Airbnb的消息
请求
{ "header": { "echoToken": "8ecfbe8f-8970-490f-91f3-f9af26bad1bc", "timeStamp": "2023-11-08T19:25:44.888Z", "version": "V1" }, "hotelId": "OPENAPI_BOTH_NAME-MSG", "distributorId": "AIRBNB", "thread": { "threadId": "222333", "businessType": "RESERVATION", "message": { "messageId": "3234553", "messageType": "TEXT", "message": "Hi, I\u0027m visiting Palermo with my family.", "translatedMessage": "Salut, je visite Palerme avec ma famille.", "createdTime": "2017-03-29T07:57:45Z", "extensions": { "userId": "124021", "userName": "Andrei" } }, "reservation": { "distributorResId": "HDTYS45DS2", "checkIn": "2017-03-29", "checkOut": "2017-04-01", "totalAmount": "1102.00", "adultCount": "3", "childCount": "1", "roomId": "323549", "extensions": { "guestCount": "4", "infantCount": "0", "petCount": "0", "days": "3", "listingId": "323549", "listingName": "Sunny Vila" } }, "extensions": { "channelStatus": "accepted", "channelType": "Reservation", "roles": [ { "role": "owner", "user_ids": [ "5678432" ] }, { "role": "guest", "user_ids": [ "124021" ] }, { "role": "cohost", "user_ids": [] } ], "users": [ { "first_name": "Andrei", "id": "124021", "location": "San Francisco", "preferred_locale": "ru" }, { "first_name": "Giuseppe", "id": "5678432", "location": "Palermo", "preferred_locale": "it" } ] } } }
成功响应
{ "header": { "echoToken": "f67ade36-0b83-49cf-bfb1-b932c45b7d34", "timeStamp": "2018-06-27T17:09:04.674Z", "version": "0.1" }, "success": true }
此回答是否有所帮助? 是 否
Send feedback