News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Get A2P SMS - get delivery status from message ID in Java
Tags: rest api
Dec 4, 2020 at 11:30am   •   1 replies  •  0 likes
Bob Mulvey

Is there a way for me, in Java, to get the delivery status of an SMS by ID? I am using the 1.6.1 java client that was just released about a week ago. Looking at the doc (https://github.com/ringcentral/ringcentral-java/blob/master/samples.md ) I can’t tell because Send A2P SMS and Get A2P SMS both seem to refer “restRequestConfig” which has no explanation yet that I see. Perhaps it does not yet exist for Java? I would really like to subscript a get notification if that was possible in the Java interface?

1 Answer
answered on Dec 4, 2020 at 12:13pm  

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.


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us