Show.json code 32 error

error-codes
api

#1

I can call https://api.twitter.com/oauth/access_token get oauth_token.
But I try to call https://api.twitter.com/1.1/users/show.json, always get

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

following is my code:
base string:

GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Fshow.json&oauth_consumer_key%3DTTxxxxxxxxxnHbK%26oauth_nonce%3D243720839%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1439373646%26oauth_token%3D7009042-PGexxxxxxxx21HkwyaGdYjQCrFz%26oauth_version%3D1.0%26user_id%3D7009042

authorization header:

oauth_consumer_key="TTQuxxxxxxxxknHbK", oauth_nonce="243720839", oauth_signature="QY%2Ft9TYeAw%2FvfXoxe5nKVk2NHF4%3D", oauth_signature_method ="HMAC-SHA1", oauth_timestamp="1439373646", oauth_token="7009042-xxxxxxxxxxxaGdYjQCrFz", oauth_version="1.0"

source code:

String TwitterUrl = "https://api.twitter.com/1.1/users/show.json";

        string timeStamp = GetTimeStamp();
        string nonce = GetNonce();

        String SigBaseStringParams = "oauth_consumer_key=" + ConsumerKey;
        SigBaseStringParams += "&" + "oauth_nonce=" + nonce;
        SigBaseStringParams += "&" + "oauth_signature_method=HMAC-SHA1";
        SigBaseStringParams += "&" + "oauth_timestamp=" + timeStamp;
        SigBaseStringParams += "&" + "oauth_token=" + user.oauth_token;
        SigBaseStringParams += "&" + "oauth_version=1.0";
        //SigBaseStringParams += "&" + "screen_name=" + user.screen_name;
        SigBaseStringParams += "&" + "user_id=" + user.user_id;
        String SigBaseString = "GET&";
        SigBaseString += Uri.EscapeDataString(TwitterUrl) + "&" + Uri.EscapeDataString(SigBaseStringParams); ;

        String Signature = GetSignature(SigBaseString, ConsumerSecret);

        string authorizationHeaderParams = "oauth_consumer_key=\"" + ConsumerKey + "\", oauth_nonce=\"" + nonce +
             "\", oauth_signature=\"" + Uri.EscapeDataString(Signature) + "\", oauth_signature_method =\"HMAC-SHA1\"" +
             ", oauth_timestamp=\"" + timeStamp + "\", oauth_token=\"" + Uri.EscapeDataString(user.oauth_token) + "\", oauth_version=\"1.0\"";

        HttpClient httpClient = new HttpClient();
        httpClient.DefaultRequestHeaders.Authorization = new HttpCredentialsHeaderValue("OAuth", authorizationHeaderParams);
        var result = await httpClient.GetAsync(new Uri(TwitterUrl));
        var content = await result.Content.ReadAsStringAsync();

How can I solve the problem? thank you.


#2

Not familiar with Java but you don’t setup a proper GET url. You must have a question mark before using any ampersands. So: page.php?key=keyvalue&key2=keyvalue. So try replacing line 15 with a ? instead of &