I've been trying to create a batch to get all the photo albums and
then all the photos in each album. I can make it work with curl by
following the example here:
http://developers.facebook.com/docs/reference/api/batch/
but with I tried it with batchfb I get "ERROR: Request 1 cannot depend
on an unresolved request with name get-albums. Requests can only
depend on preceding requests"
any clues welcome.
curl \
-F 'access_token=... your token here ' \
-F 'batch=[{ "method": "GET", "name" : "get-albums",
"relative_url": "me/albums?limit=5", }, { "method": "GET",
"relative_url": "?ids={result=get-albums:$.data.*.id}" }]'
https://graph.facebook.com/
FacebookBatcher batcher = new FacebookBatcher(access_token);
batcher.setTimeout(5000);
Later<JsonNode> albumsNode = batcher.graph("me/albums",
JsonNode.class, new Param("name", "get-albums"));
Later<JsonNode> albumPhotos = batcher.graph("?ids={result=get-albums:
$.data.*.id}", JsonNode.class);
try {
JsonNode albums = albumsNode.get();
System.out.println(albums);
System.out.println(albumPhotos);
} catch (FacebookException fbex) {
System.out.println("ERROR: " + fbex.getMessage());
}