Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme with MMS changes support #37

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -20,7 +20,7 @@ Maven
<dependency>
<groupId>com.sinch</groupId>
<artifactId>sdk-sms</artifactId>
<version>1.1.6</version>
<version>1.1.7</version>
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved
</dependency>
```

Expand Down Expand Up @@ -77,6 +77,20 @@ MtBatchTextSmsResult batch = conn.createBatch(
System.out.println("Successfully sent batch " + batch.id());
```

#### Sending MMS Message
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved

```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())
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved
.build());
```

Please visit https://developers.sinch.com/docs/sms/getting-started/java/send-sms-with-java/ for more detailed instructions.

## Building and installing
Expand Down Expand Up @@ -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
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved

In version 1.1.7 MMS messages support was added into the library, which will require code changes if you want to upgrade.
gkvasnsinch marked this conversation as resolved.
Show resolved Hide resolved

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.