diff --git a/README.md b/README.md index d1ccb04..d8fc23d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # REST API SDK for SMS -This is the Java SDK for the Sinch REST SMS API for sending and receiving single or batch SMS messages. It also supports +This is the Java SDK for the Sinch REST SMS API for sending and receiving single or batch SMS/MMS messages. It also supports scheduled sends, organizing your frequent recipients into groups, and customizing your message for each recipient using parameterization. It offers an asynchronous Java API that provides convenient access to all the features of the SMS REST API. @@ -77,6 +77,20 @@ MtBatchTextSmsResult batch = conn.createBatch( System.out.println("Successfully sent batch " + batch.id()); ``` +#### Sending MMS Message, requires version 2.x + +```java +String sender = "SENDER"; // Optional, must be valid phone number, short code or alphanumeric. +String [] recipients = {"1232323131", "3213123"}; +MtBatchMmsResult batch = +conn.createBatch( + SinchSMSApi.batchMms() + .sender(sender) + .addRecipient(recipients) + .body(SinchSMSApi.mediaBody().url("https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png").message("Hello, world!").build()) + .build()); +``` + Please visit https://developers.sinch.com/docs/sms/getting-started/java/send-sms-with-java/ for more detailed instructions. ## Building and installing @@ -106,6 +120,18 @@ in your terminal. The project will then be compiled and tested before finally be We recommend enabling annotation processing in your IDE https://immutables.github.io/apt.html. +## Sinch REST SMS API 1.x to 2.x Migration guide + +In version 2.x MMS messages support was added into the library, which will require code changes if you want to upgrade. + +1. Methods of ApiConnection for fetching or cancelling batches are returning MtBatchResult now, which you could cast to +either MtBatchMmsResult or MtBatchSmsResult depending on message type; + +2. RecipientDeliveryReport which is returned by ApiConnection.fetchDeliveryReport, you could cast to +RecipientDeliveryReportSms or RecipientDeliveryReportMms depending on message type; + +3. BatchDeliveryReport.Status is not inner class anymore and could be used as Status; + ## License This project is licensed under the MIT License. See the LICENSE file for the license text.