releasing #Twitter4J 4.0.7-SNAPSHOT – Apps using DM need to migrate

Latest Twitter4J snapshot build is now available at our in-house repository.

Twitter is going to sunset good old DM endpoints on August 16th, 2018.

In order to keep your chatbot working properly, you’ll need to migrate to Twitter4J 4.0.7.
This version is compatible with previous version with a slight exception. Rebuilding your application is required.

Here you can see the full list of API changes between 4.0.6 and 4.0.7.

The following methods are now deprecated.
ResponseList getDirectMessages()
ResponseList getDirectMessages(Paging paging)
ResponseList getSentDirectMessages()
ResponseList getSentDirectMessages(Paging paging)

The above deprecated methods are now internally invoking the latest and greatest end points. This means, your application will be working correctly without any changes even after the massacre coming this week.

But they will be removed in the future release – 4.1.0, 5.0.0 or whatever.
Please migrate to DirectMessageList getDirectMessages(int count) in a timely manner.

Note that destroyDirectMessage(long id) returns an object with dummy getters which throw UnsupportedOperationException, because the new endpoint doesn’t return any value.