winterstein / JTwitter

Java library for using Twitter (+ Identica & Wordpress). Open source under LGPL
http://www.winterwell.com/software/jtwitter.php
69 stars 27 forks source link

direct_message destroy call fails #9

Open hemantrajput opened 10 years ago

hemantrajput commented 10 years ago

Implementation for deleting a direct message is different from the twitter api. Twitter rest api expects direct message id as post parameter not in the url itself. Every time I'm getting this error message --code 34: Sorry, that page does not exist https://api.twitter.com/1.1/direct_messages/destroy/176917417644138497.json

hemantrajput commented 10 years ago

correct implementation for destroy message method which is in compliance to the twitter api-

public void destroyMessage(Number id) {
       HashMap<String, String> vars = new HashMap<String, String>();
        vars.put("id", ""+id);
        String page = post(TWITTER_URL + "/direct_messages/destroy.json", vars, true);
    assert page != null;
}