Facebook page - how can i get all albums using javascript sdk? -
i have facebook page , photos , albums public.
i've used query albums:
https://graph.facebook.com/67695062976/albums
now query writes error:
an access token required request resource.
my javascript function albums:
getalbums: function() { $.get('http://graph.facebook.com/67695062976/albums?callback=?', { }, function (res) { $('#albumscontent').html(""); $.each(res.data, function (key, value) { var image = res.data[key]; $('#albumscontent').append('<div class="photosalbums"><a id="buttonphotosalbums'+image.id+'" href="album-'+image.id+'"></a><div class="photosalbumsname">'+image.name+'</div></div>'); }); }, "json"); },
how can fix problem in javascript side?
you need access token now, public stuff of pages can use app access token, app id , app secret, combined pipe:
app-id|app-secret
there go:
https://graph.facebook.com/67695062976/albums?access_token=app-id|app-secret
if did not create app yet, it: https://developers.facebook.com/apps
Comments
Post a Comment