I'm trying to familiarize myself with Facebook's new Graph API and so far I can fetch and write some data pretty easily.
Something I'm struggling to find decent documentation on is uploading images to an album.
According to http://developers.facebook.com/docs/api#publishing you need to supply the message argument. But I'm not quite sure how to construct it.
Older resources I've read are:
http://wiki.auzigog.com/Facebook_Photo_Uploads
https://developers.facebook.com/docs/reference/rest/photos.upload/
If someone has more information or could help me tackle uploading photos to an album using Facebook Graph API please reply!
API Version Deprecations: As part of Facebook's Graph API and Marketing API, please note the upcoming deprecations: August 3, 2021: Graph API v3. 3 will be deprecated and removed from the platform. August 25, 2021 Marketing API v9.
You can't change a post's privacy without changing the privacy of the album. You can add photos to an album after you've posted them, but you can't move other types of posts. Note: You can upload up to 1000 photos to an album.
Here are some various ways to upload photos using the PHP Facebook Graph API. The examples assume you've instantiated the $facebook object and have a valid session.
This example will upload the photo to your default application album of the current user. If the album does not yet exist it will be created.
$facebook->setFileUploadSupport(true); $args = array('message' => 'Photo Caption'); $args['image'] = '@' . realpath($FILE_PATH); $data = $facebook->api('/me/photos', 'post', $args); print_r($data);
This example will upload the photo to a specific album.
$facebook->setFileUploadSupport(true); $args = array('message' => 'Photo Caption'); $args['image'] = '@' . realpath($FILE_PATH); $data = $facebook->api('/'. $ALBUM_ID . '/photos', 'post', $args); print_r($data);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With