-
Notifications
You must be signed in to change notification settings - Fork 866
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
Sample code for pinpointsmsvoicev2 (End User Messaging) #5777
Comments
Hi @asardav, I'm using the Python SDK example from the End User Messaging SMS documentation as a base: PinpointSmsVoiceV2Client client = PinpointSmsVoiceV2Client.builder()
.region(Region.US_WEST_2)
.build();
String CONFIGURATION_SET = "MyConfigurationSet";
String DESTINATION_NUMBER = "+12065550123";
String ORIGINATION_NUMBER = "+18445550142";
String MESSAGE = "<speak>" +
"This is a test message sent from <emphasis>AWS End User Messaging SMS</emphasis>" +
"using the <break strength='weak'/> AWS SDK for Java. " +
"<amazon:effect phonation='soft'>Thank you for listening." +
"</amazon:effect>" +
"</speak>";
SendVoiceMessageRequest request = SendVoiceMessageRequest.builder()
.configurationSetName(CONFIGURATION_SET)
.context(Map.of("my-key", "my-value"))
.destinationPhoneNumber(DESTINATION_NUMBER)
.maxPricePerMinute("2.00")
.messageBody(MESSAGE)
.messageBodyTextType(VoiceMessageBodyTextType.SSML)
.originationIdentity(ORIGINATION_NUMBER)
.timeToLive(120)
.voiceId(VoiceId.MATTHEW)
.dryRun(true)
.build();
SendVoiceMessageResponse response = client.sendVoiceMessage(request); Let me know if this is what you were looking for. |
yes. Can you add examples for sending MMS, SMS as well |
The other APIs follow the same idea, just fill the request with the relevant attributes. Here's SendTextMessageRequest textRequest = SendTextMessageRequest.builder()
.configurationSetName(CONFIGURATION_SET)
.context(Map.of("my-key", "my-value"))
.destinationPhoneNumber(DESTINATION_NUMBER)
.destinationCountryParameters(
Map.of(DestinationCountryParameterKey.IN_ENTITY_ID, "ENTITY98765",
DestinationCountryParameterKey.IN_TEMPLATE_ID, "TEMPLATE01234"))
.keyword(KEYWORD)
.maxPrice("2.00")
.messageBody(MESSAGE)
.messageType(MessageType.TRANSACTIONAL)
.originationIdentity(ORIGINATION_NUMBER)
.timeToLive(120)
.dryRun(true)
.build();
SendTextMessageResponse textResponse = client.sendTextMessage(textRequest); I'll reach out the Documentation team and ask to add examples using the Java SDK to the page. |
Created an internal ticket to the Docs team. Resolving this. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature
Please provide sample codes for pinpointsmsvoicev2 (End User Messaging)
Use Case
Show how to use the AWS SDK for Java 2.x to work with End User Messaging
Proposed Solution
No response
Other Information
No response
Acknowledgements
AWS Java SDK version used
v2
JDK version used
21
Operating System and version
MAC
The text was updated successfully, but these errors were encountered: