You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StackTrace: com.messagebird.exceptions.GeneralException: Failed to retrieve data from MessageBird service with response code 422 at com.messagebird.MessageBirdServiceImpl.getJsonData(MessageBirdServiceImpl.java:140) at com.messagebird.MessageBirdServiceImpl.sendPayLoad(MessageBirdServiceImpl.java:107) at com.messagebird.MessageBirdClient.sendMessage(MessageBirdClient.java:110)
ErrorReport{code=10, description='The scheduledDatetime is not in a valid format (Y-m-d\TH:i:sP).', parameter='scheduledDatetime'}
The reason is that the scheduledDatetime is not properly transformed to JSON in MessageBirdServiceImpl.getConnection()
This could easily be solved by upgrading to Jackson 2 and using
@JsonFormat(shape = Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
public Date getScheduledDatetime() {
return scheduledDatetime;
}
in Message.java
Alternative:
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
mapper.setDateFormat(df);
The text was updated successfully, but these errors were encountered:
Thanks for opening an issue. Our team will review the issue and get back to you with a solution as soon as we can. In the meantime, for our reference, could you tell us what version of Java you're using?
Hi Sam,
glad to hear from you!
I'm using Java 8, but his is not a Java issue. It's a Jackson Mapping issue.
As there is no standard way of mapping a java.util.Date into JSON format, we need to tell the Jackson Mapper how to do this. Both of my suggested solutions are suitable for that, although I personally would prefer the Jackson 2 solution.
StackTrace:
com.messagebird.exceptions.GeneralException: Failed to retrieve data from MessageBird service with response code 422 at com.messagebird.MessageBirdServiceImpl.getJsonData(MessageBirdServiceImpl.java:140) at com.messagebird.MessageBirdServiceImpl.sendPayLoad(MessageBirdServiceImpl.java:107) at com.messagebird.MessageBirdClient.sendMessage(MessageBirdClient.java:110)
ErrorReport{code=10, description='The scheduledDatetime is not in a valid format (Y-m-d\TH:i:sP).', parameter='scheduledDatetime'}
The reason is that the
scheduledDatetime
is not properly transformed to JSON in MessageBirdServiceImpl.getConnection()This could easily be solved by upgrading to Jackson 2 and using
in
Message.java
Alternative:
The text was updated successfully, but these errors were encountered: