Facebook access token invalid with message “session does not match current stored session”?

It’s possible for your access token to become invalid for a variety of reasons (expiry time passed, user changed password, user deauthorized your app, user logged out of Facebook, etc.). You should always design to account for this scenario. If your users are active, it’s easy to get a new access token from the OAuth … Read more

Facebook Graph API – Get ID from Facebook Page URL

It seems to me that the easiest solution to what you describe is to just get the id/name from the url you have using lastIndexOf(“https://stackoverflow.com/”) (which most languages have an equivalent for) and then get “https://graph.facebook.com/” + id. The data that this url returns has the id (i.e.: 6708787004) and the username (i.e.: southpark), so … Read more

How to get large photo URL in one API call?

I haven’t tried this with stream/feed photos, but the generally accepted way of doing this is: http://graph.facebook.com/{ID of object}/picture If you want the “large” version, you would do: http://graph.facebook.com/{ID of object}/picture?type=large I’m not 100% sure if this would work for an actual photo (instead of a user profile picture or page profile pic), but I … Read more

Using Facebook Graph to simply post a wall message with just javascript

Note 4/16/2011: stream.publish seems to have been deprecated, There’s a new way to do this: http://developers.facebook.com/docs/reference/dialogs/feed/ You can use something like this to publish to a wall, the user will need to confirm before it get sent. Don’t forget that you’ll need to use FB.init and include the JS SDK link. function fb_publish() { FB.ui( … Read more