我有一個有效的頁面訪問令牌,並且我正嘗試將一張圖片發佈到相冊(此相冊:https://www.facebook.com/media/set/?set=a.333031973457854.77237.323448221082896&type=3) 相冊ID是:333031973457854.77237.323448221082896 但我得到這個錯誤:OAuthException:(#803)你請求的一些別名不存在:33303197345785477237323448221082896(< - 你看到它的相冊ID) 任何人都可以引導我通過什麼我做錯了,我該如何解決它?謝謝:) 這是我的代碼:Facebook PHP拋出異常「(#803)您請求的某些別名不存在」
<?php
$fbconfig['appid' ] = "172098812914132";
$fbconfig['secret'] = "XXXXXXXXXXXXXXXXX";
$fbconfig['pageid'] = "323448221082896";
$fbconfig['token1'] = "XXXXXXXXXXXXXXXX";
$fbconfig['token2'] = "XXXXXXXXXXXX";
$fbconfig['my_ulr'] = 'http://'.$_SERVER['SERVER_NAME'];
$albumid = '33303197345785477237323448221082896';
require_once('../scripts/facebook.php');
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
));
$pageid = $fbconfig['pageid'];
$imagesDir = 'images/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
printf("Trying to upload: " . $randomImage . "\n"); // The path to the random image.
try
{
// $page_info = $facebook->api("/$pageid?fields=access_token");
// Album ID 33303197345785477237323448221082896
$args = array(
'access_token' => $fbconfig['token2'],
'source' => 'www.gorillalol.com/i/' . $randomImage,
);
$post_id = $facebook->api("/" . $albumid . "/photos","post",$args);
unlink($randomImage); // Deletes the file, so it can't get reposted.
printf("Successful Image Upload :)");
}
catch (FacebookApiException $e)
{
printf("Failed. :p");
printf($e);
}
?>
我敢肯定的是,這張專輯ID是唯一的第一個整數:'333031973457854' – Tchoupi 2013-03-02 22:12:38