Php – Some of the aliases you requested do not exist: facebook graph api, photo to album

facebookfacebook-graph-apiPHP

I am using facebook graph api to upload photos to existing album in my account.
Here is my code how i am doing.

$fb = new Facebook(array(
                    'appId'  => 'xxxxxxxxx',
                    'secret' => 'xxxxxxxxx',
                    'cookie' => 'true'
    ));

$fb->setFileUploadSupport(true);
$imagePath='C:\\wamp\\www\\photo\\photo.jpg';


    $args = array('message' => 'photo caption is...');
    $args['image'] = $imagePath;
    $data = $fb->api('/'. '5463871911515666183' . '/photos?access_token='. $user_access_token, 'POST', $args);

    print_r($data); 

when i execute this it shows an error

Fatal error: Uncaught OAuthException: (#803) Some of the aliases you requested do not exist: 5463871911515666183 thrown in C:\wamp\www\photo\facebook-php-sdk\src\base_facebook.php on line 970

Best Answer

The Problem has been solved , i was fetching album IDs using FQL, in which id of an album is represented as 'aid', While in the GRAPH API album id is represented as 'id' while uploading image to an album i am using Graph API, the same object in the FQL and Graph is represented in different. In the FQL , object_id is equavlent to the Graph API id.

Related Topic