1
我試圖通過PHP刪除照片我有一個應用程序上傳如何用捲曲
載示例的結果搶API PHP刪除照片的後期ID Facebook的:
{"id":"429774393794352","post_id":"276744849097308_429774413794350"}
第一哪一個ID或post_id將被使用
以及如何使用php選擇它?
以及如何才能通過curl庫與PHP代碼刪除
我的想法是,我將所有照片的ID存儲到SQL刪除它任何時候
我上傳的代碼,我用
$file='./'.$new_string;
$args = array(
'message' => $message,
);
$args[basename($file)] = '@' . realpath($file);
$ch = curl_init();
$url = 'https://graph.facebook.com/album id /photos?access_token='.$accsesss;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$a1=$data = curl_exec($ch);
print_r(json_decode($data,true));
echo'<br/>';
我嘗試
$args = array(
'id' => '276744849097308_429774413794350',
'access_token' => $accsesss ,
);
$ch = curl_init();
$url = 'https://graph.facebook.com/276744849097308_429774413794350?method=DELETE&access_token=$accsesss';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true); $a1=$data = curl_exec($ch);
print_r(json_decode($data,true));
echo'<br/>';
結果
Array ([error] => Array ([message] => Invalid OAuth access token. [type] => OAuthException [code] => 190))
https://developers.facebook.com/docs/reference/api/user/#photos – CBroe
什麼網址HTTP的DELETE以及如何選擇它用PHP? –
向https://graph.facebook.com/PROFILE_ID/photos?method=delete發送POST請求。那可行 ?? –