send_voice_message
async
¶
send_voice_message(
destination_phone_number: PhoneNumber,
origination_identity: VoiceMessageOriginationIdentity,
*,
config_overrides: Optional[AsyncPinpointSMSVoiceV2ClientConfig] = None,
message_body: Optional[VoiceMessageBody] = None,
message_body_text_type: Optional[VoiceMessageBodyTextType] = None,
voice_id: Optional[VoiceId] = None,
configuration_set_name: Optional[ConfigurationSetNameOrArn] = None,
max_price_per_minute: Optional[MaxPrice] = None,
time_to_live: Optional[TimeToLive] = None,
context: Optional[ContextMap] = None,
dry_run: Optional[bool] = None,
protect_configuration_id: Optional[ProtectConfigurationIdOrArn] = None,
message_feedback_enabled: Optional[bool] = None,
) -> SendVoiceMessageResult
Allows you to send a request that sends a voice message. This operation uses Amazon Polly to convert a text script into a voice message.
Parameters:
-
destination_phone_number(PhoneNumber) –The destination phone number in E.164 format.
-
origination_identity(VoiceMessageOriginationIdentity) –The origination identity to use for the voice call. This can be the PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.
If you are using a shared End User Messaging SMS resource then you must use the full Amazon Resource Name(ARN).
-
message_body(Optional[VoiceMessageBody], default:None) –The text to convert to a voice message.
-
message_body_text_type(Optional[VoiceMessageBodyTextType], default:None) –Specifies if the MessageBody field contains text or speech synthesis markup language (SSML).
-
TEXT: This is the default value. When used the maximum character limit is 3000.
-
SSML: When used the maximum character limit is 6000 including SSML tagging.
-
-
voice_id(Optional[VoiceId], default:None) –The voice for the Amazon Polly service to use. By default this is set to "MATTHEW".
-
configuration_set_name(Optional[ConfigurationSetNameOrArn], default:None) –The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
-
max_price_per_minute(Optional[MaxPrice], default:None) –The maximum amount to spend per voice message, in US dollars.
-
time_to_live(Optional[TimeToLive], default:None) –How long the voice message is valid for. By default this is 72 hours.
-
context(Optional[ContextMap], default:None) –You can specify custom data in this field. If you do, that data is logged to the event destination.
-
dry_run(Optional[bool], default:None) –When set to true, the message is checked and validated, but isn't sent to the end recipient.
-
protect_configuration_id(Optional[ProtectConfigurationIdOrArn], default:None) –The unique identifier for the protect configuration.
-
message_feedback_enabled(Optional[bool], default:None) –Set to true to enable message feedback for the message. When a user receives the message you need to update the message status using PutMessageFeedback.
Raises:
-
AccessDeniedException–The request was denied because you don't have sufficient permissions to access the resource.
-
ConflictException–Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time or it could be that the requested action isn't valid for the current state or configuration of the resource.
-
InternalServerException–The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.
-
ResourceNotFoundException–A requested resource couldn't be found.
-
ServiceQuotaExceededException–The request would cause a service quota to be exceeded.
-
ThrottlingException–An error that occurred because too many requests were sent during a certain amount of time.
-
ValidationException–A validation exception for a field.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/async_pinpoint_sms_voice_v2.py
6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 | |