アルバムが存在するかどうかをチェックし、存在しない場合は作成するFacebookアプリを作成しました。
これはすべて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