views:

481

answers:

2

Using PHP 5.2.11 and the new facebook graph code...

If I call $facebook->api("/me");

I get a proper response: array 'id' => string '10700210' (length=8) 'name' => string 'Brandon Renfrow' (length=19) 'first_name' => string 'Brandon' (length=7) 'middle_name' => string '✫' (length=3) 'last_name' => string 'Renfrow' (length=7) 'link' => string 'http://www.facebook.com/brenfrow' (length=32) 'about' => string 'Spiritual birthday: 1/22/2005' (length=29) ... ...

But if I call $facebook->api("/me/picture");

I always get a response of: null

Does anyone know why this is?

A: 

I just went to my "/me/picture" in the browser and it redirected me to a static image on one of Facebook's CDN servers. Perhaps the redirect is throwing a wrench in your api call.

Typeoneerror
+2  A: 

Well I guess the best answer I've found is to call http://graph.facebook.com/USER_ID?fields=picture to get the picture URL. Its to bad they don't document things like this on their API especially when its obvious this is broken for so many people.

Thanks for figuring this out. The Facebook Graph API is probably one of the worst designed and even more worse documented API I ever had to work with.
Luke