Search code examples
facebookfacebook-graph-apifacebook-opengraph

OpenGraph: how can i specify a filter in FB.api?


I have built a Facebook app using OpenGraph that permits the users to write reviews on concerts, so that I've defined a concert_id attribute on which the user can insert a review.

Now I would like to show all the reviews inserted for a certain concert_id but cannot find a way. If I do (in JS)

FB.api('/me/MY_APP:action', { limit: 0}, function(response) {
    console.log(response);
});

I get all items. This app has to be consumed by mobile, I think it is bad to get all items and, then, filtering only the concert_id i need. What do I have to do to apply a where condition in OpenGraph to a custom action?


Solution

  • The Facebook API will not return individual published objects for a particular action, but that's not your only problem. By the look of it, you're trying to bring in ALL the reviews given for a concert, right? (Meaning those by other users too).

    The "/me/" part of the Facebook API call will only return those published actions made by the user that is currently logged in. That won't work for you, as you want those of all your users

    The only suggestion I can give is to create a simple web service, where you store all the reviews given for the various concerts. Use this service to pull in reviews given for a particular concert. (I use a similar methodology for reviews in an app of my own).