Twitte DM API Error



We are using twitter4j library for twitter data which is throwing JSON parse error as Twitter is not sending “url” field in the response. Can you please let us know what need to be done here?

ERROR 2016-09-13 06:40:08,450 tdm.IRTdmAkkaConsumer: While processing twitterId: 61180382 row id: 34 :: JSONObject[“url”] not found.
Relevant discussions can be found on the Internet at: or
TwitterException{exceptionCode=[a315b5a9-3a29705e d18b7a18-558ecfbb], statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=4.0.5-SNAPSHOT(build: 9b7efa6faa540a9defb3e6ba9122a356155986b1)}
at twitter4j.URLEntityJSONImpl.init(
at twitter4j.URLEntityJSONImpl.(
at twitter4j.UserJSONImpl.getURLEntitiesFromJSON(
at twitter4j.UserJSONImpl.init(
at twitter4j.UserJSONImpl.(
at twitter4j.DirectMessageJSONImpl.init(
at twitter4j.DirectMessageJSONImpl.(
at twitter4j.DirectMessageJSONImpl.createDirectMessageList(
at twitter4j.JSONImplFactory.createDirectMessageList(
at twitter4j.TwitterImpl.getDirectMessages(
at com.inrev.akka.ThrottleConsumer.handleMsg(
at com.inrev.akka.ThrottleConsumer$2.apply(
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(


Thanks, I’m looking into a report of an issue with the DM API at the moment. You’ve filed this in the Fabric category, but it looks like you’re using Twitter4J and not Twitter Kit, is that correct?


Yes, mistakenly I have tagged fabric.


OK, thanks - moved to REST API.

We are working on understanding what happened here, thanks for your patience.


There was a small fix in Twitter4J in URLEntityJSONImpl: not sure if this is the error. The latest 4.0.5-SNAPSHOT hasn’t updated with the change yet - but might be worth trying the github master


In parallel, we rolled back the change that caused this issue. Apologies.


We’re seeing the same error for the Follow and Unfollow API as well. Any fix on that?


Please open a new topic for this and include a detailed description of the behaviour you’re seeing, expected results, and any libraries you’re using. This thread was specific to a DM issue that we resolved yesterday.