REST API gives Http Response code 401



Actual URL :-
oauth_nonce = 2e31769a7a984208b91f380c6c251a92 which i generated randomly
oauth_timestamp=generated using following
Calendar tempcal = Calendar.getInstance();
long ts = tempcal.getTimeInMillis();// get current time in milliseconds
String oauth_timestamp = (new Long(ts/1000)).toString(); // oauth_timestamp generated


signature BaseString: GET&

sending the signature base string to the HMAC SHA1 algorithm got the result as


below is the code i am sending
httpConn = (HttpURLConnection) url.openConnection();

    String consumerKey = "noktasToxIMzLnaqnEpGEQ";
    String authorization_header_string = "OAuth oauth_consumer_key=\""+ consumerKey+ "\",oauth_nonce=\"" + oauth_nonce+ "\",oauth_signature=\""+ oauth_signature + "\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"" +oauth_timestamp + "\",oauth_token=\"userid-fv4jsl1cVWxdpB1m8QvvNWLqUHDZeJEUzqKsz9N4\",oauth_version=\"1.0\"";
    httpConn.setDoInput(true); // true if we want to read server's response
    httpConn.setDoOutput(false); // false indicates this is a GET request


Gives following exception
Server returned HTTP response code: 401 for URL:

(Note:- USER_ID what i got is not showing here , i replace here with “userid”)

Sending this URL with the
Authorization header