Answer the question
In order to leave comments, you need to log in
Upload images to facebook album, php sdk, how to get list of albums?
Good afternoon!
I'm trying to implement auto-posting to a facebook page, I managed to publish a post, but only without an image. I found that you first need to upload the image to the album, and then attach it to the post by id.
I'm trying to get a list of page albums
require_once __DIR__ . '/ss/Facebook/autoload.php';
$app_id = "1234567";
$app_secret = "asdf1234";
$page_id = "111111";
$token = "qwerty";
$fb = new Facebook\Facebook([
'app_id' => $app_id,
'app_secret' => $app_secret,
'default_graph_version' => 'v2.5',
]);
$albums = $fb->get("/{$page_id}/albums", $token)->getGraphEdge()->asArray();
Answer the question
In order to leave comments, you need to log in
User_photos access is required to get albums in FB, did you get it in the application panel?
Status & Review -> Items in Review -> Add Items to this Submission
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question