我已经写了一个facebook应用程序,它检查相册是否存在,如果它不创建一个。Facebook创建专辑图api
这是所有工作2个星期前,现在我去检查它显示客户端,它不再工作。我认为这可能与Facebook有关,也许他们现在需要SSL?但是,我无法在网站上找到此证据。
我得到的错误是:
Warning: file_get_contents(https://graph.facebook.com/517578134925015/albums?access_token=AAAD5tUCp808BAIZBPk4eV11mlf9C92velLsDeZAm5mXhKZCkwpM3LNy7ax6BBmhuH4BVZBUN6Iycyt55NoXZAFSts9zHeCFNzT6FLJYucgT2SQG8fOYIP) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /var/www/vhosts/hidden/development/cms/backend/publishAlbum.php on line 59
我当前的代码是:
//If no album ID is set, create a new album.
$graph_url = "https://graph.facebook.com/".$pageId."/albums?" . "access_token=". $pageAccessToken;
$postdata = http_build_query(
array(
'name' => $albumName
)
);
$opts = array('http' =>
array(
'method'=> 'POST',
'header'=>
'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = json_decode(file_get_contents($graph_url, false, $context));
任何帮助表示赞赏。
感谢
编辑:
我尝试使用该API的代码。
$params = array(
'name' => 'testtest',
'message' => 'test test'
);
try{
$albumtResult = $facebook->api('/'.$pageId.'/albums', 'post', $params);
}
catch(FacebookApiException $e){
error_log($e);
$albumtResult = null;
}
$albumId = $albumtResult->id;
这里是捕获的异常:http://pastebin.com/pxeyRTDn
请将此答案标记为“已接受”,因为这实际上是导致问题的原因。 –
您必须等待24小时,只剩下2个小时。 – CharliePrynn
这已修复。它在2012年8月31日进行了测试和工作。 – CharliePrynn