dongzouhe9734 2010-05-28 18:00
浏览 45
已采纳

Facebook SDK和Graph API评论删除错误

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.

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.

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":"Unsupported delete request."}}

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.

  • 写回答

3条回答 默认 最新

  • dongyuruan2957 2010-08-10 15:56
    关注

    Fixed!

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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 Matlab在app上输入带有矩阵形式的初始条件发生错误
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题
  • ¥15 用ADS设计一款的射频功率放大器