Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph API will not give me picture data

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?

like image 246
Brandon シ Renfrow Avatar asked Jun 05 '10 01:06

Brandon シ Renfrow


People also ask

How do I get data from Facebook Graph API?

Open the Graph Explorer in a new browser window. This allows you to execute the examples as you read this tutorial. The explorer loads with a default query with the GET method, the lastest version of the Graph API, the /me node and the id and name fields in the Query String Field, and your Facebook App.

Is Facebook Graph API deprecated?

Applies to all versions. Facebook Analytics will no longer be available after June 30, 2021. Additionally, we are deprecating the App Dashboard Plugin for Marketing API. For more information visit the Business Help Center.


1 Answers

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.

like image 195
Brandon シ Renfrow Avatar answered Oct 13 '22 00:10

Brandon シ Renfrow