使用Graph API在Feed上发布消息时出错403: [英] Error 403 when using Graph API to post a message on a feed:

查看:144
本文介绍了使用Graph API在Feed上发布消息时出错403:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Graph API 和C ++程序发布信息。我尝试了三种不同的方法:

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



  1. GET具有如 https: /graph.facebook.com/USER_ID/feed?access_token=TOKEN&message=Hello

  2. POST和X-WWW_FORM

  3. POST和FORM-data


在这种情况下,我收到完整的邮件列表作为答案,但消息不会添加到Feed中。

In the case 1, I receive the complete list of messages as an answer, but the message doesn't add to the feed.

在第2和第3种情况下,我收到错误 403 回复。

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

USER_ID TOKEN 是正确的我的应用程序拥有正确的权限。我已经将图像发布到具有相同应用程序的专辑,但是我现在不可能发布消息。为什么?

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?

推荐答案

第一种方法将无法正常工作,因为您需要向该端点发出HTTP POST以发布新的Feed故事,作为商品,Facebook提供method = postGET参数来假一个帖子,这将工作

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

作为回应,您将获得新帖子的ID

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

{
   "id": "499801468_1001264776039"
}

在这里,您可以找到有关Graph API http://developers.facebook.com/docs/reference/api/#publishing

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

这篇关于使用Graph API在Feed上发布消息时出错403:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆