Facebook Batch returns: Some of the aliases you requested do not exist

314 Views Asked by At

I'm building this batch in order to get all the share counts for all the pictures in an album (and like and comments on each photo):

My Batch:

[
 {
   "method":"GET",
   "name":"get-photos",
   "relative_url":"951337131548012?fields=photos.limit(250){likes.limit(1),comments.limit(1),id,source,page_story_id},likes.limit(1)"
 },
 {
   "method":"GET",
   "relative_url":"{result=get-photos:$.photos.data.*.page_story_id}?fields=shares"
 }
]

It always returns Some of the aliases you requested do not exist with the page_story_id number, but when i'm querying the graph api for that story id i get the data..

any ideas why ?

1

There are 1 best solutions below

0
Asaf Nevo On

As I answered my question asked here: Facebook Api v2.2 - get album's photos shares count

The right batch request should be:

[
 {
   "method":"GET",
  "name":"get-photos",
  "relative_url":"951337131548012?fields=photos.limit(250){likes.limit(1),comments.limit(1),id,source,page_story_id},likes.limit(1)"
  },
 {
  "method":"GET",
  "relative_url":"/?ids={result=get-photos:$.photos.data.*.page_story_id}&fields=shares"
 }
]