我在页面上设置了“开始”按钮:
curl -X POST -H "Content-Type: application/json" -d '{
"get_started":{
"payload":"GET_STARTED_PAYLOAD"
}
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=token"
{"result":"success"}
如果我检查数据:
curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=get_started&access_token=token
我得到了一个很好的答案:
{"data":[{"get_started":{"payload":"GET_STARTED_PAYLOAD"}}]}
{
"object": "page",
"entry": [
{
"id": "id1",
"time": 1501688073860,
"standby": [
{
"recipient": {
"id": "id1"
},
"timestamp": 1501688073860,
"sender": {
"id": "id2"
},
"postback": {
"title": "Get Started"
}
}
]
}
]
}
GET_STARTED_PAYLOAD
)在webhook中。
this page
使用按钮定义的有效负载参数。这仅对发送原始模板消息的应用程序可见。