用Graph API删除Facebook的帖子 - 让这个工作变得困难 [英] Delete facebook post with Graph API - trouble getting this to work
问题描述
我正在使用以下内容在我的Facebook页面上发布消息:
I'm using the following to post a message on my Facebook page:
$attachment = array(
'access_token' => $access_token,
'message' => 'This is a test Message 4:',
'name' => "This is a test Name 4",
'link' => "http://slashdot.org/",
'description' => "This is a test Description 4"
);
$ret_code=$facebook->api('/me/feed', 'POST', $attachment);
这个功能很棒。
如何使用facebook GRAPH api删除同一篇文章?我阅读了文档,并说它发出一个POST,如:
How do I delete the same post using the facebook GRAPH api? I read the docs and it says to issue a POST like:
https://graph.facebook.com/COMMENT_ID?method=delete
要测试,我以简单的形式设置它提交按钮,将数据发布到 https://graph.facebook.com/COMMENT_ID?method=delete (替换为来自原始发布调用返回的11111111111_111111111111 id的COMMENT_ID。这将返回此API调用需要有效的app_id。
To test I set this up in a simple form with submit button, POSTing the data to https://graph.facebook.com/COMMENT_ID?method=delete (substituting COMMENT_ID fro the 11111111111_111111111111 id returned from the original publish call. This returns "This API call requires a valid app_id".
什么是正确的方法发出DELETE命令?
What is the correct way to issue a DELETE command?
推荐答案
由于您使用的是php-sdk,您只需发出此呼叫:
Since you are using the php-sdk you just issue this call:
$facebook->api("/COMMENT_ID","DELETE");
这篇关于用Graph API删除Facebook的帖子 - 让这个工作变得困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!