Skip to content

Commit 2bb4291

Browse files
committed
chore(messages): Update SendSms example to use Basic auth instead of JWT
1 parent 223b17f commit 2bb4291

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/main/java/com/vonage/quickstart/messages/sms/SendSmsText.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727

2828
public 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
}

0 commit comments

Comments
 (0)