I'm successfully posting to Facebook pages with the Thuzi/facebook-node-sdk module, but getting facebook Graph API errors, with code similar to the following:
// ...the FB key and secret are set beforehand
FB.setAccessToken(facebookPageAccessToken);
FB.api(pageId + '/feed', 'post', {
link: link,
message: text
}, function(postingResponse) {
// deal with the response here....
});
The post is made to facebook, and other users can see the post, however the response that I get is this:
{ error:
{
message: 'Unsupported post request.',
type: 'GraphMethodException',
code: 100
}
}
What I know about the GraphMethodException is that it relates to a malformed Graph API action, however, the form used here conforms to the API spec.
I have tried prepending the Graph API action with the version like this \v2.1\{page-id}\feed
just to make sure, but it's the same response and effect. Checking at the library level, I put in a console.log to check the url that was being sent:
https://graph.facebook.com/{page-id}/feed?access_token={access_token}
which looks fine. In fact, using cURL on the command line works, with Facebook returning the post ID, like normal. For example:
curl -F 'access_token={access_token}' -F 'message=testing' https://graph.facebook.com/{page-id}/feed
returns {"id":"123456789012345_123456789123450"}
Has anyone had this occur to them/found a solution?
===
To add to my post: when I add the link field to the cURL command, the result is the same as when I used the facebook-node-api, a GraphMethodException error 100.
Further, I have publish_actions and manage_pages permissions associated with the access token.
I wish it was a simple "make app visible to the public" like this link (How to fix "Unsupported post request" when posting to FB fan page?).