From 2c9be0ee6e29f3dedae6c41f11037ee2a9609f0c Mon Sep 17 00:00:00 2001 From: GalynaKvasniuk Date: Fri, 18 Aug 2023 17:34:41 +0200 Subject: [PATCH 1/4] Update readme with MMS changes support --- README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d1ccb04..4899f8f 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. @@ -20,7 +20,7 @@ Maven com.sinch sdk-sms - 1.1.6 + 1.1.7 ``` @@ -77,6 +77,20 @@ MtBatchTextSmsResult batch = conn.createBatch( System.out.println("Successfully sent batch " + batch.id()); ``` +#### Sending MMS Message + +```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("http://test.url.com").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.1.6 to 1.1.7 Migration guide + +In version 1.1.7 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. From 217172420e120d88b83f6fdf0a60ef8f5f3ed9e1 Mon Sep 17 00:00:00 2001 From: GalynaKvasniuk Date: Mon, 21 Aug 2023 13:24:15 +0200 Subject: [PATCH 2/4] review --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4899f8f..f7db20d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Maven com.sinch sdk-sms - 1.1.7 + 1.1.6 ``` @@ -87,7 +87,7 @@ conn.createBatch( SinchSMSApi.batchMms() .sender(sender) .addRecipient(recipients) - .body(SinchSMSApi.mediaBody().url("http://test.url.com").build()) + .body(SinchSMSApi.mediaBody().url("http://test.url.com").message("Hello, world!").build()) .build()); ``` @@ -120,9 +120,9 @@ 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.1.6 to 1.1.7 Migration guide +## Sinch REST SMS API 1.x to 2.x Migration guide -In version 1.1.7 MMS messages support was added into the library, which will require code changes if you want to upgrade. +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; From a9057713da2d1688712d55f05229f14cc287e890 Mon Sep 17 00:00:00 2001 From: gkvasnsinch <103099021+gkvasnsinch@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:49:56 +0200 Subject: [PATCH 3/4] Update README.md Co-authored-by: Gustav Svensk --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7db20d..42e44a8 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ conn.createBatch( SinchSMSApi.batchMms() .sender(sender) .addRecipient(recipients) - .body(SinchSMSApi.mediaBody().url("http://test.url.com").message("Hello, world!").build()) + .body(SinchSMSApi.mediaBody().url("https://en.wikipedia.org/wiki/Sinch_(company)#/media/File:Sinch_LockUp_RGB.png").message("Hello, world!").build()) .build()); ``` From 485bb3ae5f2ceb85cc79df02de9b09a495a3cb7d Mon Sep 17 00:00:00 2001 From: gkvasnsinch <103099021+gkvasnsinch@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:50:04 +0200 Subject: [PATCH 4/4] Update README.md Co-authored-by: Gustav Svensk --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42e44a8..d8fc23d 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ MtBatchTextSmsResult batch = conn.createBatch( System.out.println("Successfully sent batch " + batch.id()); ``` -#### Sending MMS Message +#### Sending MMS Message, requires version 2.x ```java String sender = "SENDER"; // Optional, must be valid phone number, short code or alphanumeric.