Facebook Photo Upload into Album on Fan Page failed

2.4k views Asked by At

I have written an Application what posts Photos on a FanPage into a Specific Album long time ago.

Now I didn't used for a half year. Now I had to set up the Application again and grant the extended Permissions to the Fan Page (streamm_publish) again. But now I've a Problem, I'm using the old REST API what now gives me the error: An unknown error ocurred with the error code 1.

Then I tried to post throught the Facebook Graph api. I tried to make a call to the Api /pageid/albumid/photos what's not working(Unknown path components) I tried to makea a call to /albumid_from_my_page/photos then the Photos were posted to my profile I tried to upload it to /pageid/photos what is the same as the one above

But the code fpr the REST Api worked well, what's the problem there, and why the new Graph Api isn't working how she should?(BUG?)

2

There are 2 answers

0
ifaour On BEST ANSWER

To post a photo to an album, this is the code:

$post_data = array(
    "message" => "My photo caption",
    "source" => '@' . realpath($file)
);
$album_id = "XXXXX";
$facebook->api("/$album_id/photos", 'post', $post_data);

Now I suppose to interact with the page albums you need a page access_token added to your $post_data array, for this check this answer.

0
Thiago Bluhm On

You need take ACCESS_TOKEN page...

try: http://graph.facebook.com/me/accounts?access_token= GET THIS TOKEN USING GRAPH API... OR MAKE USING the getAccessToken()...

and will see all pages and aplications that u have, find just application for this case and COPY TOKEN... and damn!!!

It's possible to see this token thought GRAPH API EXPLORER...

regards.