I'm trying to handle SMSs sent to my twilio account server side.
It set up the URL on twilio's dashboard:
http://f.cl.ly/items/093Q0E3l081R1H3Q3P00/Screen%20Shot%202014-12-12%20at%2012.43.54%20PM.png
The endoint is very simple:
@BodyParser.Of(BodyParser.Json.class)
public static Result handleManagerSMS() {
Logger.info("handleManagerSMS body (text):" + request().body().asText());
Logger.info("handleManagerSMS body (json):" + request().body().asJson());
IncomingSMS incomingSMS = parseRequestJson(IncomingSMS.class);
if (incomingSMS != null) {
Logger.info(incomingSMS.toString());
}
TwiMLResponse twiml = new TwiMLResponse();
return ok(twiml.toXML()).as("text/xml");
}
Both values printed are null:
[info] application - handleManagerSMS body (text):null
[info] application - handleManagerSMS body (json):null
I was expecting to get the data described here:
https://www.twilio.com/docs/api/twiml/sms/twilio_request
Any idea? Thanks