Open saleempbt5 opened 5 years ago
I have used php curl to post links with images to a facebook page, unfortunately it gets error as response in sometimes
i have used the following code
$url = "https://graph.facebook.com/".$pageId."/feed"; $attachment = array( 'access_token' => "Token", 'link' =>$uris, 'picture' => $imgurl_url, 'name' => $title, 'description'=>$description, ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output $result = curl_exec($ch); curl_close ($ch); $ary = json_decode($result); if(isset($ary->id)){ echo "Posted to facebook"; }
Even sometimes the response is error with subcode 99, the link gets posted to the page. the response i getting for this call is {code=>1, "unknown error occured", subcode:99}
I have used php curl to post links with images to a facebook page, unfortunately it gets error as response in sometimes
i have used the following code
Even sometimes the response is error with subcode 99, the link gets posted to the page. the response i getting for this call is {code=>1, "unknown error occured", subcode:99}