{
"type":"postback",
"title":"<BUTTON_TEXT>",
"payload":"<DEVELOPER_DEFINED_PAYLOAD>"
}
curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"<PSID>"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Try the postback button!",
"buttons":[
{
"type":"postback",
"title":"Postback Button",
"payload":"DEVELOPER_DEFINED_PAYLOAD"
}
]
}
}
}
}' "https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>"
{ "recipient_id": "1254477777772919", "message_id": "AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P" }
屬性 | 類型 | 描述 |
---|---|---|
| 字串 | 按鈕類型。必須是 |
| 字串 | 按鈕標題。20 個字元限制。 |
| 字串 | 這個數據會回傳給您的 webhook。1000 個字元限制。 |