我正在尝试快速回复 facebook messenger - 在下面收到此错误:
2017-01-22T04:18:40.538348+00:00 app[web.1]: Error: { message: '(#100) Invalid keys "message" were found in param "message".',
2017-01-22T04:18:40.538359+00:00 app[web.1]: type: 'OAuthException',
2017-01-22T04:18:40.538361+00:00 app[web.1]: code: 100,
2017-01-22T04:18:40.538361+00:00 app[web.1]: fbtrace_id: 'F9umRNKYj+/' }
2017-01-22T04:18:40.907028+00:00 app[web.1]: Error: { message: '(#100) Invalid keys "message" were found in param "message".',
2017-01-22T04:18:40.907040+00:00 app[web.1]: type: 'OAuthException',
这是我在下面使用的代码 - 我从他们的开发者网站中提取的示例 facebook 代码。
function startUpMenu(sender) {
let messageData = {
"message":{
"text":"Pick a color:",
"quick_replies":[{
"content_type":"text",
"title":"Red",
"payload":"RedText"
},
{
"content_type":"text",
"title":"Green",
"payload":"GreenText"
}]
}
}
request({
url: 'https://graph.facebook.com/v2.6/me/messages',
qs: {access_token:token},
method: 'POST',
json: {
recipient: {id:sender},
message: messageData,
}
}, function(error, response, body) {
if (error) {
console.log('Error sending messages: ', error)
} else if (response.body.error) {
console.log('Error: ', response.body.error)
}
})
}
请问有谁知道如何解决这个问题?