Facebook API - delete status

Posted by Simon R on Stack Overflow See other posts from Stack Overflow or by Simon R
Published on 2010-05-18T15:36:28Z Indexed on 2010/05/18 15:41 UTC
Read the original article Hit count: 296

Filed under:
|
|
|
|

In PHP, I'm using curl to send a delete to the fb graph api - and yet I'm getting the following error;

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

The code I'm using is;

$ch = curl_init("https://graph.facebook.com/" . $status_id . ""); 
curl_setopt($ch, CURLOPT_VERBOSE, 1); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query); 
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);  
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
curl_setopt($ch, CURLOPT_CAINFO, NULL); 
curl_setopt($ch, CURLOPT_CAPATH, NULL); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); 

$result = curl_exec($ch); 
echo $result;

$query contains the access token.

© Stack Overflow or respective owner

Related posts about php

Related posts about facebook