I need to subscribe the facebook app and the page to get notifies on page feed updates in order to send private replies to visitors comments. for that i need to post a curl command to the following URL
https://graph.facebook.com/${PAGE_ID}/subscribed_apps?subscribed_fields=feed&access_token=${PAGE_ACCESS_TOKEN}.
And I need to receive following json object to my console.
{"success": "true"}
but I dont receive it. I cannot find whats the error. facebook developer docs as this
I wrote my code as follows. please help me on this
const connectPage = (req, res) => {
return new Promise((resolve, reject) => {
try {
let URL = `https://graph.facebook.com/${PAGE_ID}/subscribed_apps?subscribed_fields=feed&access_token=${PAGE_ACCESS_TOKEN}`;
request(
{
uri: URL,
method: POST,
},
(err, res) => {
if (!err) {
console.log(res);
resolve();
} else {
reject(err);
console.log(err);
}
}
);
} catch (e) {
reject(e);
console.log(e);
}
});
};