Error 32 when trying to use GET search/tweets


#1

I am trying to make a search query using the Authenticated user’s oauth token (not application only).

With the token I have I am able to verify_credentials and post a new status without issue, however when I attempt to do a search using the same token I am unable to get past error 32.

Functioning statuses/update.json baseString is:

POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json&oauth_consumer_key%3Djx32mMq73u9MI0vtlQw%26oauth_nonce%3D6312384%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1375736079%26oauth_token%3D1624158942-T0bULUxVYroMtnnJ7i8j1EF46ss7qFOuga8Eaa5%26oauth_token_secret%3DXqxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4%26oauth_version%3D1.0%26status%3DDefault%2520share%2520text%2520BBHGLoc%253A1123%252C9%252C74

Data before encode:
oauth_consumer_key=jx32mMq73u9MI0vtlQw
oauth_nonce=6312384&oauth_signature_method=HMAC-SHA1
oauth_timestamp=1375736079
oauth_token=1624158942-T0bULUxVYroMtnnJ7i8j1EF46ss7qFOuga8Eaa5
oauth_token_secret=Xqxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4
oauth_version=1.0
status=Default%20share%20text%20BBHGLoc%3A1123%2C9%2C74

Problematic search/tweets.json baseString is:

GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json&oauth_consumer_key%3Djx32mMq73u9MI0vtlQw%26oauth_nonce%3D3061537%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1375736720%26oauth_token%3D1624158942-T0bULUxVYroMtnnJ7i8j1EF46ss7qFOuga8Eaa5%26oauth_token_secret%3DXqxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4%26oauth_version%3D1.0%26q%3DBBHGLoc

Data before encode:
oauth_consumer_key=jx32mMq73u9MI0vtlQw
oauth_nonce=3061537
oauth_signature_method=HMAC-SHA1
oauth_timestamp=1375736720
oauth_token=1624158942-T0bULUxVYroMtnnJ7i8j1EF46ss7qFOuga8Eaa5
oauth_token_secret=Xqxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4
oauth_version=1.0
q=BBHGLoc

Is there something I am missing with using GET search/tweets properly?
Thanks.


#2

It looks like you’re including the oauth_token_secret as a parameter in your signature base string when it’s not used in the basestring nor the parameters you’re sending Twitter in the request. You only need to use the oauth_token_secret as part of your “composite signing key” – $consumerSecret + “&” + $accessTokenSecret