Debug Facebook API Requests
9 Jun, 2009 | Written by Jon | under Facebook Development
Facebook has a great tool to debug API requests that is a bit tough to find / under documented. If you add the php code…
$GLOBALS['facebook_config']['debug']=true;
at the top of your page, and then make an api call to users->getinfo for example, then the debug tool outputs the following on your HTML page (inline, in a neat Ajax click to see details type box):
Params:
Array
(
[uids] => 780432493
[fields] => uid,first_name,last_name,name,locale,pic_square,profile_url
)
XML:
<?xml version="1.0" encoding="UTF-8"?>
<users_getInfo_response>
<user>
<uid>780432493</uid>
<uid>780432493</uid>
<first_name>Jon</first_name>
<last_name>Pastor</last_name>
<name>Jon Pastor</name>
<locale>en_US</locale>
<pic_square>http://profile.ak.facebook.com/v224/904/100/q780432493_3916.jpg</pic_square>
<profile_url>http://www.facebook.com/profile.php?id=780432493</profile_url>
</user>
</users_getInfo_response>
SXML:
SimpleXMLElement Object
(
[@attributes] => Array
(
[list] => true
)
[user] => SimpleXMLElement Object
(
[uid] => Array
(
[0] => 780432493
[1] => 780432493
)
[first_name] => Jon
[last_name] => Pastor
[name] => Jon Pastor
[locale] => en_US
[pic_square] => http://profile.ak.facebook.com/v224/904/100/q780432493_3916.jpg
[profile_url] => http://www.facebook.com/profile.php?id=780432493
)
)
PHP:
Array
(
[0] => Array
(
[uid] => 780432493
[first_name] => Jon
[last_name] => Pastor
[name] => Jon Pastor
[locale] => en_US
[pic_square] => http://profile.ak.facebook.com/v224/904/100/q780432493_3916.jpg
[profile_url] => http://www.facebook.com/profile.php?id=780432493
)
)
Very helpful for debugging to say the least!






One day I will write something here...I promise. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an...

