0

I'm building a batch request for the Facebook API by looping the following code:

//$fbid = a user's facebook id      
$query = array (
            'method' => "GET",
            //'name' => "{$fbid}",
            'relative_url' => '/'.$fbid.'/friends?fields=name,first_name,last_name,id,work,education&access_token='.$token
        );

This works fine. However, when I uncomment the third line with the name => parameter, I get no data back. I've found numerous examples that do exactly this, so I can't figure out why it doesn't work.

The reason I need to add this field is because I need to associate the returned friends to the correct original user. This seemed like an easy way to do it, but I'm open to alternatives. Thanks!

UPDATE: According to this post the API doesn't support the name parameter UNLESS you use it for assigning dependancies. So that would explain why my approach doesn't work... anyone have a solution that does work?

Community
  • 1
  • 1
emersonthis
  • 32,822
  • 59
  • 210
  • 375
  • I’m only guessing, but since FQl involves JSON as data format in most cases, it _could_ be that a numeric id does not make for a valid name identifier. Try prefixing it with a letter. – CBroe Jun 12 '12 at 16:49

1 Answers1

0

According to this post the API doesn't support the name parameter UNLESS you use it for assigning dependancies. So that would explain why my approach doesn't work... anyone have a solution that does work?

emersonthis
  • 32,822
  • 59
  • 210
  • 375