Hi all,
Using Foursquare V2 Api and php, I'm trying to list my friends.
I need a list like:
http://developer.foursquare.com/docs/explore.html#req=users/self/friends
To do so, I'm following:
http://developer.foursquare.com/docs/users/friends.html
And (I think) I do the authentication correctly, as I reach the Allow
page and if I print $token I get what it seems the right info. But
printing $res shows the same info as printing $token .. Can anyone
give me a hand in here?
The code is below. Thanks a lot!!
<?php
//requires taken from
https://github.com/jmathai/foursquare-async
require_once('EpiCurl.php');
require_once('EpiSequence.php');
require_once('EpiFoursquare.php');
$fsObj = new EpiFoursquare($clientId, $clientSecret);
$url = $fsObj->getAuthorizeUrl($redirectUrl);
echo "<a href=\"$url\">Click here</a>";
$thecode = $_GET['code'];
// I insert $thecode in database here
$token = $fsObj->getAccessToken($thecode, $redirectUrl);
$fsObj->setAccessToken($thecode);
$res = $fsObj->get('
https://api.foursquare.com/v2/users/',
array('USER_ID' => 'self'));
print_r ($res);
?>