send_notify_voice_message
¶
send_notify_voice_message(
notify_configuration_id: NotifyConfigurationIdOrArn,
destination_phone_number: PhoneNumber,
template_variables: TemplateVariableSubstitutionMap,
*,
config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = 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.
>>> 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/pinpoint_sms_voice_v2.py
5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 | |