我有Send API的问题 . 我试图使用POSTMAN,cURL将消息发布到我的Messenger帐户 . 它与POSTMAN或cURL一起正常工作 . 但是,我已经构建了Node.js来发送消息 . 错误是“参数user_id是必需的” . 我不知道如何解决这个问题 . 因为在文档中,没有user_id字段 .
const body = {
"recipient": {
"id": SOME_PAGE_SCOPE_ID
},
"message": {
"text": "Test Message"
}
};
request({
methods: "POST",
uri: `https://graph.facebook.com/v${GRAPH_API_VERSION}/me/messages`,
qs: {
access_token: ACCESS_TOKEN
},
body: body,
json: true
}).then(fulfil => console.log(fulfil)).error(err => console.log(err));
LS . GRAPH_VERSION是2.9参考链接是https://developers.facebook.com/docs/messenger-platform/send-api-reference