I am having trouble deleting a facebook post from my web app. Now I know the Facebook documentation and other SO posts say to do this:

You can delete objects in the graph by issuing HTTP DELETE requests to
the object URLs, i.e,
DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1

But since Im such a noob, I dont fully understand the short explanation of deleting with an HTTP request. Since it did not work when I tried, I assume that simply redirecting to the formed url in the example above does not delete anything. This means theres some new area of web development that I now have to understand... HTTP requests.

Additional Information:

I have tried many different variations of:

$facebook->api($post_url, 'DELETE', array('method'=> 'delete') );

The URL I am passing is '/post_id'. The post_id is being captured at post creation and stored into the database. This id matched the $_GET['story_fbid'] that can be found on any post permalink. Perhaps this is not the correct id? I am retrieving the id with the following:

4 Answers
4

Based on your comment "this is a page" I had a look at the Graph API's Page details. If I understand the details right, Delete is unsupported for Page Posts. Each connection in the details (Events, Posts, Question etc) have a Create section and if the Connection supports Delete it has a Delete description. The Posts (to feed) section only mentions Create, not Delete.

I have been using publish_stream permissions (and manage_pages because this is a page). I tried the POST method you described and got the following error Error: Unsupported post request.
–
SystemAccountDec 24 '12 at 4:07

It looks like you are right. It mentions nothing of Delete and says this in the Unpublished post section: Unpublishing a post is not supported. Ill leave this open for a few days just in case someone has a hack for it, but it looks like you'll be getting the check. Thanks for saving me from an unproductive all-nighter
–
SystemAccountDec 24 '12 at 4:40

For some reason this does not work for me. It returns true but does not delete anything on the page. How is the post id being captured? Please see the additional information I added to my question.
–
SystemAccountDec 24 '12 at 3:30