0

例えば

FB.api('/me/permissions="user_photos"', function (response) { });

それ以外の

FB.api({ method: 'fql.query', query: 'SELECT user_photos FROM permissions WHERE uid=me()' }, function(resp) {
    for(var key in resp[0]) {
        if(resp[0][key] === "1")
            console.log(key+' is granted')
        else
            console.log(key+' is not granted')
    }
});
4

1 に答える 1

0

Yes, Theres a way called selection in graph api or more advance field expansion:

You can choose the fields (or connections) you want returned with the "fields" query parameter, Example:

FB.api('/me/permissions?fields=user_photos', function (response) { });

Graph API Explorer Demo

EDIT: Quoted directly from graph api doc:

Selection

By default, most object properties are returned when you make a query. You can choose the fields (or connections) you want returned with the "fields" query parameter. For example, this URL will only return the id, name, and picture of Ben: https://graph.facebook.com/bgolub?fields=id,name,picture

You can also request multiple objects in a single query using the "ids" query parameter. For example, the URL https://graph.facebook.com?ids=arjun,vernal returns both profiles in the same response.

The "ids" query parameter also accepts URLs. This is useful for finding IDs of URLs in the Open Graph. For example: https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/

Additionally, there is a special identifier me which refers to the current user. So the URL https://graph.facebook.com/me returns the active user's profile.

When retrieving Posts via the /home, /feed, or /posts connection, you can restrict the results to only those with a location attached by adding with=location to the URL parameters:

https://graph.facebook.com/me/home?with=location

Source: Graph API Docs

于 2012-10-07T12:27:56.860 に答える