Please hold on to use the Java SDK with A2P methods directly as we are updating the specs which may cause code breaks later.
For now, I recommended to use the post() and get() method directly with specified endpoint and params.
public ResponseBody get(String endpoint, Object queryParameters) throws IOException, RestException {
return request(HttpMethod.GET, endpoint, queryParameters, null);
}
public ResponseBody post(String endpoint, Object object) throws IOException, RestException {
return request(HttpMethod.POST, endpoint, null, object, ContentType.JSON);
}
E.g.
public class Filters {
public String view = "";
public String dateFrom = "";
public String dateTo = "";
}
/*
Other valid filters
perPage: integer
batchId: string
direction: Array
phoneNumber: Array
*/
public void read_a2p_message_store() {
var params = new Filters();
params.view = "Detailed";
params.dateFrom = "2020-11-20T00:00:00.000Z";
params.dateTo = "2020-11-30T00:00:00.000Z";
ResponseBody resp = restClient.get("/restapi/v1.0/account/~/a2p-sms/messages", params);
System.out.println(resp.string());
}
We will update the SDK as soon as we can.