send_notify_text_message
¶
send_notify_text_message(
notify_configuration_id: NotifyConfigurationIdOrArn,
destination_phone_number: PhoneNumber,
template_variables: TemplateVariableSubstitutionMap,
*,
config_overrides: Optional[PinpointSMSVoiceV2ClientConfig] = None,
template_id: Optional[NotifyTemplateId] = 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,
) -> SendNotifyTextMessageResult
Sends a templated text 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". -
time_to_live(Optional[TimeToLive], default:None) –How long the text 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:
SendNotifyTextMessage Send an OTP verification code via SMS using a notify configuration.
>>> client.send_notify_text_message(notify_configuration_id='nc-1234567890abcdef0', destination_phone_number='+12065550100', template_variables={'code': '123456', 'expiry': '10'})
Source code in docs_src/capo_pinpoint_sms_voice_v2/_services/pinpoint_sms_voice_v2.py
5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 | |