Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API upload photo from URL

I have a website with photo gallery and I'd like to upload each photo (one by one) to my facebook page (not wall). I managed to post a message but now I want to upload a photo to a FB Page Wall by uploading an existing image from the server - specific URL (I don't want to upload again locally). Is this possible?

like image 540
ilija veselica Avatar asked Jul 03 '12 14:07

ilija veselica


2 Answers

Yes you can do it
Example In Graph Api Explorer
Make the call post, set url to https://graph.facebook.com/me/photos,
Add field with key message and value "any custom message"
Add another field with key url and value https://appharbor.com/assets/images/stackoverflow-logo.png
click submit

like image 82
maaz Avatar answered Oct 12 '22 03:10

maaz


You need to know the album id and make call POST to:

https://graph.facebook.com/albumid/photos?access_token=$access_token

You will find the album id entering into the album and looking at the URL. Will be something like https://www.facebook.com/media/set/?set=a.XXXXXXXXXXX.YYYY.ZZZZZZZZZZ&type=3

Your album id are the XXXX.

like image 36
Martinson Avatar answered Oct 12 '22 02:10

Martinson