I am having trouble deleting a facebook message from my web application. Now I know the Facebook documentation and other SO posts that say to do this:
You can delete objects in the graph by issuing HTTP DELETE requests to the object URLs, ie, DELETE https://graph.facebook.com/ID?access_token=... HTTP/1.1
But since Im is such a noob, I do not fully understand the short explanation of deletion using an HTTP request. Since this did not work when I tried, I assume that simply redirecting to the generated url in the above example does not delete anything. This means that there is a new area of web development that I must now understand ... HTTP requests.
How is this done in php? php manual also does not help.
Additional Information:
I tried many different options:
$facebook->api($post_url, 'DELETE', array('method'=> 'delete') );
The URL I'm passing is '/post_id' . post_id is fixed when mail is created and stored in the database. This identifier corresponds to $_GET['story_fbid'] , which can be found at any constant position. Perhaps this is not a valid identifier? I am returning an identifier with the following:
//post to wall $postResult = $facebook->api($post_url, 'post', $msg_body ); //capture the id of the post $this->fb_post_id = $postResult['id'];
When I run the code above, no errors occur. Touching it causes echo diagnostics after it starts.
These are the different string combinations that I passed the api with $post_url :
/postid api returns true, nothing is deleted from Facebook /userid_postid api returns false, Error: (#100) Invalid parameter /postid_userid api returns false, Error: (#1705) : Selected wall post for deletion does not exist /accesstoken_postid api returns false, Error: (#803) Some of the aliases you requested do not exist /postid_accestoken api returns false, Error: (#803) Some of the aliases you requested do not exist