I have an application in Java which I use to connect to Twitter. So far I have used it to connect to Twitter’s STREAM API using a POST, and I have done this successfully.
Now I am trying to get user information using the users/show.json
However I am not sure which way the base signature string should be.
If I try:
String signatureBaseString = "GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Fshow.json&oauth_consumer_key%3D" +
CONSUMER_KEY + "%26oauth_nonce%3D" + oauthNonce
+ "%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D" + oauthTimestamp + "%26oauth_token%3D"
+ ACCESS_TOKEN + "%26oauth_version%3D1.0";
This returns user not found (as I have not specified a user).
However if I add a user to the end:
String signatureBaseString = "POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fusers%2Fshow.json&oauth_consumer_key%3D" +
CONSUMER_KEY + "%26oauth_nonce%3D" + oauthNonce
+ "%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D" + oauthTimestamp + "%26oauth_token%3D"
+ ACCESS_TOKEN + "%26oauth_version%3D1.0%26screen_name%3D" + screenName;
I receive an authentication error. What am I doing incorrectly?
Thanks