I want to integrate fb into my website and pull work_history. I've literally gone through every forum question and read the fb pages. From what I've read you need a token to access the info. Do you also need to run a fql query? How can I get the token to get friends work_history? Below is what I tried.
$user = $facebook->getUser();
$token = array($facebook->getAccessToken());
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
$fql = "SELECT uid, name, work_history, FROM user WHERE
uid = ' . $user.'";
$ret_obj = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql,
));
echo '<pre>Pic: ' . $ret_obj[3]['work_history'] .'</pre>';
} catch (FacebookApiException $e) {
error_log($e);
$user_profile = null;
}
}
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'user_work_history',
'redirect_uri' => 'http://www.myweb.com')
);
}