json - public photo album suddenly requiring access_token -
i have been porting albums in websites below code , has stopped working. albums , photos public seems want access_token.
here graph particular album:
https://graph.facebook.com/483171821709416/photos
here javascript i've been using:
$.getjson('//graph.facebook.com/483171821709416/photos?callback=?',function(json){ $.each(json.data,function(){ $('<li></li>') .append('<span class="thumb" style="background: url(' + this.images[1].source + ') center no-repeat; background-size: 140%;"><a href=' + this.images[0].source + ' rel="gallery"></a></span>') .appendto('#album-gallery'); }); });
assuming own these photos, , indeed public, need produce page access token, has no expiry. creating app clicking button, , setting domain, no actual coding needed. go through scenario
when user grants app manage_pages permission, app able obtain page access tokens pages user administers querying [user id]/accounts graph api endpoint. migration enabled, when using short-lived user access token query endpoint, page access tokens obtained short-lived well.
exchange short-lived user access token long-lived access token using endpoint , steps explained earlier. using long-lived user access token, querying [user id]/accounts endpoint provide page access tokens not expire pages user manages. apply when querying non-expiring user access token obtained through deprecated offline_access permission.
https://graph.facebook.com/oauth/access_token? client_id=app_id& client_secret=app_secret& grant_type=fb_exchange_token& fb_exchange_token=existing_access_token
Comments
Post a Comment