After trying out multiple tutorials, it appears that the latest version of the Graph API has caused some issues with my code.
Here is the snippet I am working with:
function fetchAlbumImages(){
FB.api(
'/760126260690750/photos',
'GET',
{"limit":"100",
"access_token":"833367813443301|nDhKBT0o6K7a7j_5LMfc3QSbRNs"},
function (response) {
if (response && !response.error) {
displayGallery(response);
} else
console.log(response.error);
});
}
function displayGallery(imagesJSON) {
for (var i=0, length = imagesJSON.data.length; i < length; i++){
var image = imagesJSON.data[i];
$('body').append(image.name);
}
};
However, no content is being added to the body. Upon investigating further, I noticed that the /albumid/photos method returns a photo object with only ID, title, and date. Here's a snippet of the data retrieved from my query:
{
"data": [
{
"created_time": "2015-07-23T21:39:40+0000",
"name": "summer is here!! #adisfrutar #relax #funnytime 💘😊🌴☀🐙🎼",
"id": "903479883022053"
},
It seems like the new API doesn't provide the image URL as before.
My concern now is how can I extract the image URLs from the album page so that I can showcase a gallery on my website?