File tree Expand file tree Collapse file tree
src/main/java/com/vonage/quickstart/messages/sms Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828public class SendSmsText {
2929 public static void main (String [] args ) throws Exception {
30- VonageClient client = VonageClient .builder ()
31- . applicationId ( VONAGE_APPLICATION_ID )
32- . privateKeyPath ( VONAGE_PRIVATE_KEY_PATH )
33- .build ();
30+ VonageClient client = VonageClient .builder ()
31+ . apiKey ( VONAGE_API_KEY )
32+ . apiSecret ( VONAGE_API_SECRET )
33+ .build ();
3434
35- var response = client .getMessagesClient ().sendMessage (
36- SmsTextRequest .builder ()
37- .from (SMS_SENDER_ID ).to (MESSAGES_TO_NUMBER )
38- .text ("This is an SMS text message sent using the Messages API" )
39- .build ()
40- );
41- System .out .println ("Message sent successfully. ID: " + response .getMessageUuid ());
42- }
35+ var response = client .getMessagesClient ().sendMessage (
36+ SmsTextRequest .builder ()
37+ .from (SMS_SENDER_ID ).to (MESSAGES_TO_NUMBER )
38+ .text ("This is an SMS sent using the Vonage Messages API. " )
39+ .build ()
40+ );
41+ System .out .println ("Message sent successfully. ID: " + response .getMessageUuid ());
42+ }
4343}
You can’t perform that action at this time.
0 commit comments