Facebook Graph API 状态更新 PHP
我已经成功开始使用 Facebook Graph API
我已经能够使用 javascript 重定向到我指定了“publish_stream”的权限允许页面,我已经收到了有效的 access_token
我想更新用户的状态。按照 Facebook 的文档,我尝试发布到:
https://graph.facebook.com/{user_id}/ feed/access_token=x&message=y
(其中 {user_id} 是用户的 facebook uid 等)
我尝试过使用 CURL 以及 file_get_contents 作为 POST 和 GET 请求。我收到的唯一响应是用户之前状态的列表,它不会使用我发送的数据更新状态。
我一定是错过了什么。文档说这就是我所需要的
Ive managed to started working with the Facebook Graph API
Ive been able to use javascript to redirect to the permissions allow page where Ive specified "publish_stream", Ive received a valid access_token
I want to update the user's status. Following Facebook's documentation I am attempting to post to:
https://graph.facebook.com/{user_id}/feed/access_token=x&message=y
(where {user_id} is the user's facebook uid etc)
Ive tried using CURL, as well as file_get_contents so both as POST and GET requests. The only response I received is a list of the user's previous statuses, it will not update the status with the data im sending.
I must be missing something. The documentation says that's all I need
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您仍然遇到此代码的问题,请告诉我,因为我有一个完整的版本,而这台计算机尚未保存!无论如何!我注意到的一件主要事情是您的网址中额外的“/”:
https://graph.facebook.com/{user_id}/feed/access_token=x&message=y
应该是:
我构建的代码是
我从这里获得了这段代码。
我希望这有帮助,
乔恩
Tell me if you're still having problems with this code as I have a completed version which this computer doesn't have saved on it! Anyhow! One main thing I've notices is the extra '/' in your url:
https://graph.facebook.com/{user_id}/feed/access_token=x&message=y
should be:
and the code that I built from was
and I got this code from here.
I hope this helps,
Jon