我正在尝试使用REST api检索我的SMS日志,但我无法弄清楚如何过滤DateSent为> =或< =比给定日期.
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
Map<String, String> filters = new HashMap<String, String>();
filters.put("DateSent", "2014-04-27");
filters.put("To", "+XXXXXXXXX");
MessageList messages = client.getAccount().getMessages(filters);
根据此处的文档https://www.twilio.com/docs/api/rest/message#list-get-filters,您可以发送> =或< =,但无法确定在哪里放置不等式.
解决方法:
Twilio文档肯定是不完整和令人困惑的.
试试这个:filters.put(“DateSent>”,“2014-04-27”);
您甚至可以传递两个参数来检索日期之间的消息:
filters.put("DateSent>", "2014-04-20");
filters.put("DateSent<", "2014-04-27");