Here is my code to send send direct message using scribe. But it gives me null response. What am I doing wrong?
OAuthRequest req;
OAuthService s;
s = new ServiceBuilder()
.provider(TwitterApi.class)
.apiKey(APIKEY)
.apiSecret(APISECRET)
.callback(CALLBACK)
.build();
req = new OAuthRequest(Verb.POST, "https://api.twitter.com/1/direct_messages/new.format?user_id="+user_id+"&text=my app test");
s.signRequest(MyTwitteraccesToken, req);
Response response = req.send();
if (response.getBody() != null) {
String t=response.getBody();
Log.w("twittersent","twittersent"+t);
}
Can anybody help me ?
Try specifying the format as XML or JSON in your request URL. Also, make sure your entire text file is URL encoded.