Nodge Yii-eauth API calls

Hi there,

I’ve used this extension for integrating Twitter login, and everything goes fine but I have problem when making API signed requests that uses some parameters.

Calls like these go fine:

http://api.twitter.com/1/account/verify_credentials.json

http://api.twitter.com/1/statuses/home_timeline.json

but I cant have it working along with some parameters like "include_entities" that should be passed as a GET parameter

https://dev.twitter.com/docs/api/1/get/statuses/home_timeline




                //THIS WORKS FINE

                $timeline = $authIdentity->makeSignedRequest('http://api.twitter.com/1/statuses/home_timeline.json');


               //TRYING TO ADD PARAMETERS WITH "query" OPTION		

               $timeline = $authIdentity->makeSignedRequest('http://api.twitter.com/1/statuses/home_timeline.json', array(

                        'query' => array(

                                'include_entities' => true,

                                'count' => 40

                        ))

		);


              //PARAMETERS GET IGNORED EVEN WHEN DIRECTLY ENCODED IN THE URL		

               $timeline = $authIdentity->makeSignedRequest('http://api.twitter.com/1/statuses/home_timeline.json?include_entitities=true');




Things get even worst when trying to make a post request since this call




               

              $timeline = $authIdentity->makeSignedRequest('https://api.twitter.com/1/statuses/update.json', array(

                        'data' => array(

                                'status' => 'this is a test'

                        ))

		);




Makes twitter tell me: Error 413 Request Entity Too Large

Does anybody tried to work with APIs once authenticated with this extension?

I’ve just addressed part of the problem. Class EOAuthService was cuttin GET parameters cause they werent considered while creating the OAuthRequest. Now editing the makeSignedRequest in this way




	public function makeSignedRequest($url, $options = array(), $parseJson = true) {

		if (!$this->getIsAuthenticated())

			throw new CHttpException(401, Yii::t('eauth', 'Unable to complete the request because the user was not authenticated.'));

						

		$consumer = $this->getConsumer();

		$signatureMethod = new OAuthSignatureMethod_HMAC_SHA1();

		$token = $this->getAccessToken();

		

		$requestParameters=NULL;

		if(isset($options['parameters']))

			$requestParameters = $options['parameters'];

		

		$request = OAuthRequest::from_consumer_and_token($consumer, $token, isset($options['data']) ? 'POST' : 'GET', $url, $requestParameters);

		$request->sign_request($signatureMethod, $consumer, $token);

		$url = $request->to_url();

		

		return $this->makeRequest($url, $options, $parseJson);

	}



you can make API calls with GET request parameters doing something like this




$timeline = $authIdentity->makeSignedRequest('https://api.twitter.com/1/statuses/home_timeline.json', 

													array(

														'parameters'=>array(

																		'count'=>50,

																		'include_entities'=>'true'

																	  )

														)

													);



At this time remains the issue regarding API calls with POST data that returns me the error 413, Request Entity Too Large.

I used this extension too, logging in via twitter works perfect for me.

The only problem is that i don’t know how to post tweets and do api calls to the authenticated user. So on what object can you use the makesignedrequest function?

authIdentity -> what object is that?

The login with twitter is easy to get, all the questions are about how to post.

Is it possible?

Could anyone who knows how to do it reply to this post?