php – Facebook API – 删除状态

前端之家收集整理的这篇文章主要介绍了php – Facebook API – 删除状态前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
PHP中,我使用curl将删除发送到fb图形api – 然而我收到以下错误;
{"error":{"type":"GraphMethodException","message":"Unsupported delete request."}}

我正在使用的代码是;

$ch = curl_init("https://graph.facebook.com/" . $status_id . ""); 
curl_setopt($ch,CURLOPT_VERBOSE,1); 
curl_setopt($ch,CURLOPT_RETURNTRANSFER,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,CURLOPT_CAINFO,NULL); 
curl_setopt($ch,CURLOPT_CAPATH,CURLOPT_FOLLOWLOCATION,0); 

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

$query包含访问令牌.

固定!

删除时,必须将userid添加到对象ID:

删除https://graph.facebook.com/673509687_104812882909249?access_token= {access_token}哪里673509687是我的userID,104812882909249是objectID

原文链接:https://www.f2er.com/php/133181.html

猜你在找的PHP相关文章