send_notify_voice_message
async
¶
send_notify_voice_message(
notify_configuration_id: NotifyConfigurationIdOrArn,
destination_phone_number: PhoneNumber,
template_variables: TemplateVariableSubstitutionMap,
*,
config_overrides: Optional[AsyncPinpointSMSVoiceV2ClientConfig] = None,
template_id: Optional[NotifyTemplateId] = None,
voice_id: Optional[VoiceId] = None,
time_to_live: Optional[TimeToLive] = None,
context: Optional[ContextMap] = None,
configuration_set_name: Optional[ConfigurationSetNameOrArn] = None,
dry_run: Optional[bool] = None,
message_feedback_enabled: Optional[bool] = None,
) -> SendNotifyVoiceMessageResult
Sends a templated voice message through a notify configuration to a recipient's phone number.
Parameters:
-
notify_configuration_id(NotifyConfigurationIdOrArn) –The unique identifier of the notify configuration to use for sending the message. This can be either the NotifyConfigurationId or NotifyConfigurationArn.
-
destination_phone_number(PhoneNumber) –The destination phone number in E.164 format.
-
template_id(Optional[NotifyTemplateId], default:None) –The unique identifier of the template to use for the message.
-
template_variables(TemplateVariableSubstitutionMap) –A map of template variable names and their values. All variable values are passed as strings regardless of the declared variable type. For example, pass
INTEGERvalues as"42"andBOOLEANvalues as"true"or"false". -
voice_id(Optional[VoiceId], default:None) –The voice ID to use for the voice message.
-
time_to_live(Optional[TimeToLive], default:None) –How long the voice message is valid for, in seconds. 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.
-
configuration_set_name(Optional[ConfigurationSetNameOrArn], default:None) –The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.
-
dry_run(Optional[bool], default:None) –When set to true, the message is checked and validated, but isn't sent to the end recipient.
-
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.
Examples:
SendNotifyVoiceMessage Send an OTP verification code via voice call using a notify configuration.
>>> await client.send_notify_voice_message(notify_configuration_id='nc-1234567890abcdef0', destination_phone_number='+12065550100', template_variables={'code': '123456', 'expiry': '10'}, voice_id='JOANNA')
Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/async_pinpoint_sms_voice_v2.py
5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 | |