Hi, I am trying to capture all the photos from a specific album (always the same hardcoded id). I am using the Graph API PHP SDK from Facebook. This is my code:
<?php require 'phpfiles/facebook.php'; $facebook = new Facebook(array( 'appId' => 'aaaa', 'secret' => 'bbbb', 'cookie' => true )); $user_profile = $facebook->api('/1881235503185/photos?access_token=cccc'); var_dump($user_profile);
Result of var_dump:
array(1) { ["data"]=> array(0) { } }
- 1881235503185 is the identifier of my album, which is not limited, it is open to everyone.
- access_token is the token I get from my application page for my fb id. I'm not wrong.
- I have permissions (user_photos) and you are trying to add a dozen other permissions.
- When I try to use the Graph API, it works.
When I use the Javascript SDK, it works fine ...
FB.api('/1881235503185/photos?access_token=cccc', function(response) { alert(response.data[0].name); });
Exit: Diep in the put
Did I forget something?
php facebook facebook-graph-api
Jeroenvdb
source share