Facebook SDK 和 Graph API 评论删除错误

Facebook SDK and Graph API Comment Deleting Error(Facebook SDK 和 Graph API 评论删除错误)
本文介绍了Facebook SDK 和 Graph API 评论删除错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

使用 Facebook php SDK 时,考虑到评论的 id 和 xid,我在弄清楚如何删除评论时遇到了很多麻烦.

Working with the Facebook php SDK's, I am having a lot of trouble figuring out how to delete comments, given its id and xid.

起初我使用的是 REST API,您可以在其中调用 'comments_remove($xid, $id);'删除评论.当 xid 参数只接受字母数字字符和下划线时,此方法就会出现问题.基于文档 (http://developers.facebook.com/docs/reference/fbml/comments ) 一个有效的 XID 可以是任何 url_encode 的结果.

At first I was using the REST API, where you can call 'comments_remove($xid, $id);' to delete a comment. The problem with this method came when the xid parameter only accepts alphanumeric characters and underscores. Based on the documentation (http://developers.facebook.com/docs/reference/fbml/comments ) a valid XID can be the result of any url_encode.

现在我正在使用新的 GRAPH api 测试我的运气.在删除对象"下查看 http://developers.facebook.com/docs/api, 看来是肯定支持删除评论了.但是,我尝试发送 DELETE 请求,并且还尝试使用参数method=delete"向对象 url 发送 POST 和 GET.

Now I am testing my luck with the new GRAPH api. Looking at http://developers.facebook.com/docs/api under 'Deleting Objects', It seems that comment deleting is definitely supported. However, I have tried sending a DELETE request, and I have also tried sending POST and GET to the object url with the argument 'method=delete'.

不管我怎么尝试,我总是得到同样的错误:

No matter how I try it, I always get the same error:

{"error":{"type":"GraphMethodException","message":"不支持的删除请求."}}

{"error":{"type":"GraphMethodException","message":"Unsupported delete request."}}

我也将访问令牌作为参数发送.我发送的访问令牌是从 javascript cookie 上的单点登录保存在 facebook cookie 中的访问令牌.这些都是对我的申请的评论.这是否发生在其他人身上,或者我只是做错了?

I am sending the access token as a parameter as well. The access token that I am sending is the access token saved in the facebook cookie from the single sign on javascript cookie. These are all comments made on my application. Does this happen to anyone else, or am I simply not doing this right?

非常感谢任何帮助或指导.

Any help or guidance is GREATLY appreciated.

推荐答案

已修复!

删除时必须在对象 ID 前面加上用户 ID:

You have to prepend the userid to the object ID when deleting:

删除https://graph.facebook.com/673509687_104812882909249?access_token?access_token}在哪里673509687 是我的用户 ID,104812882909249 是对象 ID

DELETE https://graph.facebook.com/673509687_104812882909249?access_token={access_token} where 673509687 is my userID and 104812882909249 is the objectID

这篇关于Facebook SDK 和 Graph API 评论删除错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)