errors message: Could not authenticate you (code:32)

@WhatsRank What`s Rank

I try to use users/search.json and i received this error code:
"{"errors":[{"message":"Could not authenticate you","code":32}]}"

any ideas how to fix this?

This is my code:
$url = "";

$consumer_key = "XYZ";
$oauth_access_token = "XYZ";
$consumer_secret = "XYZ";
$oauth_access_token_secret = "XYZ";

$oauth = array( 'oauth_consumer_key' => $consumer_key,
'oauth_nonce' => time(),
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => $oauth_access_token,
'oauth_timestamp' => time(),
'oauth_version' => '1.0');

/*-------Create OAuth signature -----------*/
$base_info = buildBaseString($url, 'GET', $oauth);
$composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);
$oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
$oauth['oauth_signature'] = $oauth_signature;

/*-------Set up HTTP header --------*/
$header = array(buildAuthorizationHeader($oauth), 'Expect:');
$options = array( CURLOPT_HTTPHEADER => $header,
CURLOPT_URL => $url,

$feed = curl_init();
curl_setopt_array($feed, $options);
$json = curl_exec($feed);

1 year 23 weeks ago


@episod Taylor Singletary

I recommend using an OAuth library. In this case it looks like you're not building you signature base string correctly -- you need to sort the query parameters that are part of your URL. See Creating a signature.

1 year 23 weeks ago
@codedeluxe Code Deluxe

There appears to be no PHP API library for 1.1

1 year 17 weeks ago
@markbolgiano Mark Bolgiano

30 year coder, but trying to move my apps (which run from my computer only - relatively modest data acquisition) to OAuth-authenticated REST API calls, and I am experiencing

{"errors":[{"message":"Could not authenticate you","code":32}]}

on all of my GET and PUT attempted requests too. When I first tested the code, I did see a valid JSON response on a couple of requests (wish I had noted which ones - I didn't expect to be banging my head against the wall for 2 days).

I have tried re-creating apps and OAuth parameters, etc. I know a lot of people have encountered this suddenly but there does not seem to be a definitive answer. Has ANYONE figured out what causes

{"errors":[{"message":"Could not authenticate you","code":32}]}

Any help would be welcome. I implemented the original URL-based REST calls on an unorthodox platform - in VBA (I know, I know - but it is very useful for the use case), have debugged extensively, am pretty familiar and comfortable with the encoding and hashing steps, and the key-pair authentication concepts... but know that OAuth has so many "gotchas" that rolling my own is not optimum. Just the same, this is what I need to make work.

I would be very happy to share ALL of the tokens (I can change them after I solve this) or any debugging to expose each step. Thanks in advance to whomever is able to help!

1 year 21 weeks ago
@Khumzinoh Sfisokhumalo

I can't send a direct tweet to my followers it deny.

1 year 17 weeks ago
@Coldfight Amedeo Bonanno

Has anyone found a solution to this yet? If not, then this may help?

I've noticed this happening with calls that require parameters. For instance:, works, works, gives me that error, "Could not authenticate you"

1 year 1 week ago
@episod Taylor Singletary

That tends to indicate something is amiss with your OAuth signing process -- usually it means that your parameters aren't being properly sorted into the signature base string before signing.

1 year 1 week ago
@adiwanee Aleksandar

+1 same problem here

44 weeks 6 days ago
@dragact DragAct

Same error. works but doesn't

43 weeks 5 days ago
@sumitg2386 Sumit Gulati

Same error. works but doesn't in android app. Both are working fine in iPhone.

36 weeks 6 days ago
@ShanghaiTimes ♫ ShanghaiTimes 上海时报

I have the same problem her now. I'm using AS3, AIR on Flash Everything is going fine, the program even tells me the post was successfull - but it wasn't because I get this.
{"errors":[{"message":"Could not authenticate you","code":32}]}

It would be real nice if that error message would actually also say WHY it wasn't authenticating ....

This, from the api errir code table is obviously not right..
32 Could not authenticate you Your call could not be completed as dialed.

see here

Here are the responses I'm getting from a trace so far.
Obviously with the keys changed to xxxxx's

The numbers are line numbers.

1516:Here we are calling Auth
1639PinPoint Xtra puts ShanghaiTimes here:
1640:Sending Tweet via
1 {"errors":[{"message":"Could not authenticate you","code":32}]}
Event Complete:
Username: ShanghaiTimes
User Id: 16xxxxxxxx
OAuth Token: 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQ
OAuth Token Secret: oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgw

I keep trying, hopefully next week will see it ok

31 weeks 4 days ago
@tokalpeshdp Kalpesh Parmar

i got the cURL string using OAuth tool
curl --get '' --data 'cursor=-1&include_user_entities=false&screen_name=sitestreams&skip_status=true' --header 'Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="XXXXXX", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="XXXXXX", oauth_token="XXXXXX", oauth_version="1.0"' --verbose

and my php code is

$url = trim('');
$postArr = array('cursor'=>'-1','screen_name'=>'tokalpeshdp','skip_status'=>'true','include_user_entities'=>'false');
$othArr = array('Authorization: OAuth oauth_consumer_key="XXXXX",oauth_nonce="XXXXX",oauth_signature="XXXXX", oauth_signature_method="HMAC-SHA1",oauth_timestamp="XXXXX",oauth_token="XXXXX",oauth_version="1.0"');
$ch = curl_init($url);
if ($ch === FALSE){
throw new Exception('failed to initialize');
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postArr);
curl_setopt($ch, CURLOPT_HTTPHEADER,$othArr);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT,2000);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
$result = curl_exec($ch);
echo "Error: >> ".curl_error($ch);

echo "Result: >> ".$result;


{"errors":[{"message":"Could not authenticate you","code":32}]}Result: >> 1

so what is the wrong with my code.

24 weeks 6 days ago
@episod Taylor Singletary

Are you generating your signature and timestamp at runtime while setting up this code? The signatures and timestamps generated by the OAuth tool will not be valid for more than a few minutes.

24 weeks 6 days ago
@Divya_Edward Divya Edward

Login with twitter was working fine with version 1.1, until recently a couple of days back, i see this response. {"errors":[{"message":"Could not authenticate you","code":32}]}.
What could be the reason??
I am using the updated version of Abraham Williams library.

23 weeks 6 days ago