Daniel
Daniel

Reputation: 11

how to get JSON response in php from Facebook

I want to receive the JSON Response from (Facebook) https://graph.facebook.com for further processing in PHP.

How can I access the JSON

Upvotes: 1

Views: 785

Answers (1)

lazywiz
lazywiz

Reputation: 1111

I am not sure if its really an amateur question, be it so the answer is :

If you want to get the friends list:

$access_tok = $cookie['access_token'];
$friends_url = 'https://graph.facebook.com/me/friends?access_token=' . $access_tok;

curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($c);
$page = json_decode(curl_exec($c));
curl_close($c);
...

More details on http://developers.facebook.com/docs/api

I hope that was your question. -varun

Upvotes: 4

Related Questions