PHP Classes

Twitter api an get/search

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Twitter api an get/search  >  (Un) Subscribe thread alerts  
Subject:Twitter api an get/search
Summary:An error sending oauth headers along with query parameters
Messages:8
Author:Jaap Moolenaar
Date:2012-11-01 17:07:53
Update:2012-11-30 22:00:58
 

  1. Twitter api an get/search   Reply   Report abuse  
Picture of Jaap Moolenaar Jaap Moolenaar - 2012-11-01 17:07:53
Using your default twitter configuration I am able to login and do POST request, if I however use get/search (and sending query string) for instance I get a "Could not authenticate you" (32) error from the API.

I reckon it's in the sending of the oauth header.

When I disable authorization_header for the Twitter server, all seems to work fine.

I noticed you updated the class, and added "url_parameters". It could be that this fixes the errors. I will try and see whether this is true. Sorry in advance if it turns out to be ;)

  2. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Jaap Moolenaar Jaap Moolenaar - 2012-11-01 17:17:12 - In reply to message 1 from Jaap Moolenaar
It seems to be an issue still, i now need to disable both "new" options:

$this->authorization_header = false;
$this->url_parameters = false;

  3. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-02 04:21:19 - In reply to message 1 from Jaap Moolenaar
Can you tell me the exact API URL and parameters you are using so I can reproduce the problem?

  4. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Stuart Laverick Stuart Laverick - 2012-11-29 15:32:08 - In reply to message 3 from Manuel Lemos
Hello Manuel,
I am experiencing the same issues.
I can call https://api.twitter.com/1.1/account/verify_credentials.json as part of retrieving an OAuth token from Twitter without a problem.
If I then start to call some of the other endpoints, e.g.
api.twitter.com/1.1/users/show.json (GET)
api.twitter.com/1.1/followers/ids.j ... (GET)
api.twitter.com/1.1/friends/ids.jso ... (GET)
api.twitter.com/1.1/blocks/ids.json (GET)
I will get error Code 32 'Could not authenticate you'
If I set authorization_header to 0 then it will work, however even then if I call users/lookup.json via POST I get error Code 215 'Bad Authentication data'
This seems to be a Twitter specific issue as I use this class to connect to Facebook too without any issues.
Thanks
Stuart

  5. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Stuart Laverick Stuart Laverick - 2012-11-29 16:40:42 - In reply to message 4 from Stuart Laverick
Quick update,
it seems if I use GET I need to set authorization_header to FALSE, but if I use POST I need to set it to TRUE

Thanks
Stuart

  6. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-30 09:09:13 - In reply to message 5 from Stuart Laverick
Yes, authorization_header should be true and the parameters should always be passed in the URL, but that is the default set by the current class version.

Are you using the latest class version? It should be at least 1.35 but 1.38 is the latest.

  7. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Jaap Moolenaar Jaap Moolenaar - 2012-11-30 15:03:47 - In reply to message 6 from Manuel Lemos
Hi Manuel,

Upgrading to 1.38 worked for me.

Sorry for the late reaction, I wasn't being notified by the site...

  8. Re: Twitter api an get/search   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-30 22:00:58 - In reply to message 7 from Jaap Moolenaar
Isn't the site notifying you when this thread is updated? Are you subscribed to the thread? Check the Subscribe link above.