sdiegolo78 Posted April 28, 2012 Share Posted April 28, 2012 hello, i want to extract the sender_id, sender_alias and text from the array that should be returned when requesting access to direct messages via API. I get the error "Fatal error: Call to undefined method TwitterOAuth::request() " referring to the line $direct_message = $OAuth->request('GET', $OAuth->url('https://api.twitter.com/1/direct_messages.json'), array('sender_id','screen_name' ,'text')); // create new instance $OAuth = new TwitterOAuth($consumer_key,$consumer_secret, $oAuthToken, $oAuthSecret); $direct_message = $OAuth->request('GET', $OAuth->url('https://api.twitter.com/1/direct_messages.json'), array('sender_id','screen_name' ,'text')); $direct_message = json_decode($OAuth->response['response'], true); echo response; Link to comment https://forums.phpfreaks.com/topic/261764-extraction-of-values-from-a-twitter-json-array/ Share on other sites More sharing options...
silkfire Posted April 28, 2012 Share Posted April 28, 2012 Probably because there is no method there called "request". See my syntax: $direct_message = $OAuth->oAuthRequest('https://api.twitter.com/1/direct_messages.json', 'GET', array('sender_id','screen_name' ,'text')); Link to comment https://forums.phpfreaks.com/topic/261764-extraction-of-values-from-a-twitter-json-array/#findComment-1341398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.