Cannot retrieve friends ids


hi i have this code below:

$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
$twitterObj->setToken($_SESSION['ot'], $_SESSION['ots']);
$twitterFriends=$twitterObj->get_friendsIds(array('screen_name' => 'himanshujaju'));
echo $twitterFriends->responseText;
foreach($twitterFriends as $friend) { echo $friend->id; }

this alwasys shows response as {“errors”:[{“code”:37,“message”:“Not authorized to use this endpoint”}]}

i am using epitwitter classes…any code suggestion?


That’s a generic access denied message. How are you populating $_SESSION[‘ot’] and $_SESSION[‘ots’] ?


session variables are fine because i can post a new tweet and get user info as well…


It’s likely that your library is calling the wrong end point. is no longer a valid resource, nor is – only and are valid URLs for this API.


thank you very very much…!! can you tell any good new library for php??


Yes, tmhOAuth is very lightweight:

And @abraham’s twitteroauth is fantastic:


hi dude i m here