开发者

Error 403 when using Graph API to post a message on a feed:

I'm trying to post a message using the Graph API and a C++ program. I have tried three different methods:

  1. GET with a URL like https://graph.facebook.com/USER_ID/feed?access_token=TOKEN&message=Hello
  2. POST and X-WWW_FORM
  3. POST and FORM-data

In the case 1, I receive the complete list of messages as an answer, but the message d开发者_高级运维oesn't add to the feed.

In the case 2 and 3, I receive an error 403 as the response.

USER_ID and TOKEN are correct and my application has the right permissions. I have reached posting an image to an album with the same application, but it's impossible for me right now to publish messages. Why?


The first method won't work because you need to issue an HTTP POST to that endpoint to publish a new feed story, as a commodity facebook provides the "method=post" GET parameter to "fake" a post, this will work

https://graph.facebook.com/USER_ID/feed?access_token=TOKEN&message=Hello&method=post

and as response you'll get the id of the new post

{
   "id": "499801468_1001264776039"
}

Here you can find more details on publishing with the Graph API http://developers.facebook.com/docs/reference/api/#publishing

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜