如果我发送Facebook快速回复JSON,如下所示:
"quick_replies":[
{"content_type":"text","payload":"RED","title":"Red"},
{"content_type":"text","payload":"BLUE","title":"Blue"},
{"content_type":"text","payload":"GREEN","title":"Special"},
]
并且用户选择" Special"回复,我回来了
{"recipient_id":5555,"text":"Special"}
我认为有效载荷字段的重点是提供一个除了将要发回的标题之外的值,但似乎Facebook只发送所选回复的标题,这引出了一个问题......什么&# 39; s有效载荷字段的重点?
答案 0 :(得分:5)
是的 - 你是对的,你应该对有效载荷做出如此回应。 正如你在这里看到的: https://developers.facebook.com/docs/messenger-platform/send-api-reference/quick-replies#callback
回应应该是:
{
"sender": {
"id": "USER_ID"
},
"recipient": {
"id": "PAGE_ID"
},
"timestamp": 1464990849275,
"message": {
"mid": "mid.1464990849238:b9a22a2bcb1de31773",
"seq": 69,
"text": "Red",
"quick_reply": {
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED"
}
}
}
并且正如@Keith Coughtrey所说,你应该启用messaging_postbacks权限。