{"page_id":12345,"recipient":{"id":"123456" },"message":{"template_type":"button","text":"What do you want to do next?","buttons":[ {"type":"web_url","url":"https://www.messenger.com","title":"Visit Messenger" } ] },"tag":"ACCOUNT_UPDATE","delay": 3,}
参数解释
message
画册消息
请求参数示例:
{"page_id":12345,"recipient":{"id":"123456" },"message":{"template_type":"generic","elements":[ {"title":"Welcome!","image_url":"https://petersfancybrownhats.com/company_image.png","subtitle":"We have the right hat for everyone.","default_action":{"type":"web_url","url":"https://petersfancybrownhats.com/view?item=103","webview_height_ratio":"tall" },"buttons":[ {"type":"web_url","url":"https://petersfancybrownhats.com","title":"View Website" }, {"type":"postback","title":"Start Chatting","payload":"DEVELOPER_DEFINED_PAYLOAD" } ] } ] },"tag":"ACCOUNT_UPDATE","delay": 3,}
参数解释
message
message.elements
对于每一条消息,常规模板最多支持 10 个元素。除 title 之外,还必须至少设置一种属性。
列表消息
请求参数示例:
{"page_id":12345,"recipient":{"id":"123456" },"message":{"template_type":"list","top_element_style":"compact","elements":[ {"title":"Classic T-Shirt Collection","subtitle":"See all our colors","image_url":"https://peterssendreceiveapp.ngrok.io/img/collection.png","buttons":[ {"title":"View","type":"web_url","url":"https://joinchat.ai","messenger_extensions":true,"webview_height_ratio":"tall","fallback_url":"https://peterssendreceiveapp.ngrok.io/" } ] }, {"title":"Classic White T-Shirt","subtitle":"See all our colors","default_action":{"type":"web_url","url":"https://joinchat.ai","messenger_extensions":false,"webview_height_ratio":"tall" } }, {"title":"Classic Blue T-Shirt","image_url":"https://peterssendreceiveapp.ngrok.io/img/blue-t-shirt.png","subtitle":"100% Cotton, 200% Comfortable","default_action":{"type":"web_url","url":"https://joinchat.ai","messenger_extensions":true,"webview_height_ratio":"tall","fallback_url":"https://peterssendreceiveapp.ngrok.io/" },"buttons":[ {"title":"Shop Now","type":"web_url","url":"https://joinchat.ai","messenger_extensions":true,"webview_height_ratio":"tall","fallback_url":"https://peterssendreceiveapp.ngrok.io/" } ] } ],"buttons":[ {"title":"View More","type":"postback","payload":"payload" } ] },"tag":"ACCOUNT_UPDATE","delay": 3,}
参数解释
message
message.elements
回执消息
请求参数示例:
{"page_id":12345,"recipient":{"uuid":"123456" },"message":{"template_type":"receipt","recipient_name":"Stephane Crozatier","order_number":"12345678902","currency":"USD","payment_method":"Visa 2345","order_url":"http://petersapparel.parseapp.com/order?order_id=123456","timestamp":"1428444852","address":{"street_1":"1 Hacker Way","street_2":"","city":"Menlo Park","postal_code":"94025","state":"CA","country":"US" },"summary":{"subtotal":75.00,"shipping_cost":4.95,"total_tax":6.19,"total_cost":56.14 },"adjustments":[ {"name":"New Customer Discount","amount":20 }, {"name":"$10 Off Coupon","amount":10 } ],"elements":[ {"title":"Classic White T-Shirt","subtitle":"100% Soft and Luxurious Cotton","quantity":2,"price":50,"currency":"USD","image_url":"http://petersapparel.parseapp.com/img/whiteshirt.png" }, {"title":"Classic Gray T-Shirt","subtitle":"100% Soft and Luxurious Cotton","quantity":1,"price":25,"currency":"USD","image_url":"http://petersapparel.parseapp.com/img/grayshirt.png" } ] },"tag":"ACCOUNT_UPDATE","delay": 3,}
参数解释
message
message.address
message.summary
The property values of the summary object should be valid, well-formatted decimal numbers, using '.' (dot) as the decimal separator. Please note that most currencies only accept up to 2 decimal places.
Optional. Set to true to enable the native share button in Messenger for the template message. Defaults to false.
recipient_name
String
The recipient's name.
order_number
String
The order number. Must be unique.
currency
String
The currency of the payment.
payment_method
String
The payment method used. Providing enough information for the customer to decipher which payment method and account they used is recommended. This can be a custom string, such as, "Visa 1234".