@@ -68,7 +68,7 @@ Add this dependency to your project's POM:
68
68
<dependency >
69
69
<groupId >com.telstra.messaging</groupId >
70
70
<artifactId >telstra-messaging</artifactId >
71
- <version >3.0 -SNAPSHOT</version >
71
+ <version >3.1 -SNAPSHOT</version >
72
72
</dependency >
73
73
```
74
74
@@ -615,7 +615,7 @@ The function `messages.send` can be used to send a message.
615
615
616
616
It takes an object with following properties as argument:
617
617
618
- - ` to ` : The destination address, expected to be a phone number of the form ` +614XXXXXXXX ` or ` 04XXXXXXXX ` .
618
+ - ` to ` : The destination address list , expected to be a phone number of the form ` +614XXXXXXXX ` or ` 04XXXXXXXX ` .
619
619
- ` from ` : This will be either one of your Virtual Numbers or your senderName.
620
620
- ` messageContent ` (Either one of messageContent or multimedia is required): The content of the message.
621
621
- ` multimedia ` (Either one of messageContent or multimedia is required): MMS multimedia content.
@@ -636,7 +636,7 @@ It returns an object with the following properties:
636
636
637
637
- ` messageId ` : Use this UUID with our other endpoints to fetch, update or delete the message.
638
638
- ` status ` : The status will be either queued, sent, delivered or expired.
639
- - ` to ` : The recipient's mobile number(s).
639
+ - ` to ` : The list of recipient's mobile number(s).
640
640
- ` from ` : This will be either one of your Virtual Numbers or your senderName.
641
641
- ` messageContent ` : The content of the message.
642
642
- ` multimedia ` : The multimedia content of the message (MMS only).
@@ -662,59 +662,65 @@ import static org.junit.Assert.assertEquals;
662
662
import static org.junit.Assert.assertNotNull ;
663
663
664
664
try {
665
- ApiClient defaultClient = new ApiClient ();
666
- ApiClient apiClient = getAuthToken(defaultClient);
667
- MessagesApi messagesApi = new MessagesApi (apiClient);
668
- String to = " 0411220643" ;
669
- String from = " 0400000004" ;
670
- String messageContent = " Hello customer, this is from CBA to confirme your offer!" ;
671
- Multimedia multimedia = new Multimedia ();
672
- String type = " image/jpeg" ;
673
- String fileName = " image/jpeg" ;
674
- String payload = " iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" ;
675
- multimedia. setType(type);
676
- multimedia. setFileName(fileName);
677
- multimedia. setPayload(payload);
678
- List<Multimedia > multimediaList = new ArrayList<> ();
679
- multimediaList. add(multimedia);
680
- Integer retryTimeout = 10 ;
681
- String scheduleSend = " 2023-09-11T03:48:47.096Z" ;
682
- Boolean deliveryNotification = false ;
683
- String statusCallbackUrl = " http://www.example.com" ;
684
- List<String > tagsList = new ArrayList<> ();
685
- tagsList. add(" laborum" );
686
- tagsList. add(" esse" );
687
- tagsList. add(" irure Lorem" );
688
- tagsList. add(" dolore aliqu" );
689
- tagsList. add(" pariatur do proident magna ut" );
690
- tagsList. add(" id sunt" );
691
- tagsList. add(" u" );
692
- tagsList. add(" tempor velit minim" );
693
- tagsList. add(" sit dolo" );
694
- tagsList. add(" laborum qui" );
665
+ ApiClient defaultClient = new ApiClient ();
666
+ ApiClient apiClient = getAuthToken(defaultClient);
667
+ MessagesApi messagesApi = new MessagesApi (apiClient);
695
668
696
- SendMessagesRequest sendMessagesRequest = new SendMessagesRequest ()
697
- .to(to)
698
- .from(from)
699
- .messageContent(messageContent)
700
- .multimedia(multimediaList)
701
- .retryTimeout(retryTimeout)
702
- .scheduleSend(scheduleSend)
703
- .deliveryNotification(deliveryNotification)
704
- .statusCallbackUrl(statusCallbackUrl)
705
- .tags(tagsList);
669
+ List<String > toList = new ArrayList<> ();
670
+ toList. add(" 0400000001" );
671
+ toList. add(" 0400000002" );
672
+ String from = " 0400000001" ;
673
+ String messageContent = " Hello customer, this is from CBA to confirme your offer!" ;
706
674
707
- MessageSent response = messagesApi. sendMessages(sendMessagesRequest);
708
- System . out. println(response);
709
- assertNotNull(response. getMessageId());
710
-
675
+ Multimedia multimedia = new Multimedia ();
676
+ String type = " image/jpeg" ;
677
+ String fileName = " image/jpeg" ;
678
+ String payload = " iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" ;
679
+ multimedia. setType(type);
680
+ multimedia. setFileName(fileName);
681
+ multimedia. setPayload(payload);
682
+ List<Multimedia > multimediaList = new ArrayList<> ();
683
+ multimediaList. add(multimedia);
684
+
685
+ Integer retryTimeout = 10 ;
686
+ String scheduleSend = " 2024-08-15T20:48:47.096Z" ;
687
+ Boolean deliveryNotification = false ;
688
+ String statusCallbackUrl = " http://www.example.com" ;
689
+ List<String > tagsList = new ArrayList<> ();
690
+ tagsList. add(" laborum" );
691
+ tagsList. add(" esse" );
692
+ tagsList. add(" irure Lorem" );
693
+ tagsList. add(" dolore aliqu" );
694
+ tagsList. add(" pariatur do proident magna ut" );
695
+ tagsList. add(" id sunt" );
696
+ tagsList. add(" u" );
697
+ tagsList. add(" tempor velit minim" );
698
+ tagsList. add(" sit dolo" );
699
+ tagsList. add(" laborum qui" );
700
+
701
+ SendMessagesRequest sendMessagesRequest = new SendMessagesRequest ()
702
+ .to(toList)
703
+ .from(from)
704
+ .messageContent(messageContent)
705
+ .multimedia(multimediaList)
706
+ .retryTimeout(retryTimeout)
707
+ .scheduleSend(scheduleSend)
708
+ .deliveryNotification(deliveryNotification)
709
+ .statusCallbackUrl(statusCallbackUrl)
710
+ .tags(tagsList);
711
+
712
+
713
+ MessageSent response = messagesApi. sendMessages(sendMessagesRequest);
714
+ System . out. println(response);
715
+ assertNotNull(response. getMessageId());
716
+
711
717
} catch (ApiException e) {
712
- System . err. println(" Exception when calling MessagesApi" );
713
- System . err. println(" Status code: " + e. getCode());
714
- System . err. println(" Reason: " + e. getResponseBody());
715
- System . err. println(" Response headers: " + e. getResponseHeaders());
716
- e. printStackTrace();
717
- }
718
+ System . err. println(" Exception when calling MessagesApi" );
719
+ System . err. println(" Status code: " + e. getCode());
720
+ System . err. println(" Reason: " + e. getResponseBody());
721
+ System . err. println(" Response headers: " + e. getResponseHeaders());
722
+ e. printStackTrace();
723
+ }
718
724
719
725
```
720
726
0 commit comments