Please help me to make a correct request to Facebook api. Now i’ve got:
https://graph.facebook.com/me/albums?fields=photos
As the result I get very big Json with a lot of unnecessary info. I tried to do something like this:
https://graph.facebook.com/me/albums?fields=photos?fields=source,name,id
or like this:
https://graph.facebook.com/me/albums?fields=photos&fields=source,name,id
But graph api explorer, returned the same big response, or i caught an error.
Any ideas how to do more compact response with only necessary info?
You may only use
fieldswith properties that exists for objects.By issuing GET request to next URL you’ll get list of albums ids only:
Same can be achieved by running next
FQLquery onalbumtable:Actually
albumsconnection ofuserdoesn’t really contain list ofphotoobjects butalbum(which havephotosconnection). So to get photos owned by user you’ll need iterate over all of his object and getting photos for every album. Again you may usefieldsargument to limit resulting data. This can be done faster if using batch requests.Or With
FQLit may be done like this (two tablesphotoandalbuminvolved):