PinpointSMSVoice / Client / send_voice_message

send_voice_message#

PinpointSMSVoice.Client.send_voice_message(**kwargs)#

Create a new voice message and send it to a recipient’s phone number.

See also: AWS API Documentation

Request Syntax

response = client.send_voice_message(
    CallerId='string',
    ConfigurationSetName='string',
    Content={
        'CallInstructionsMessage': {
            'Text': 'string'
        },
        'PlainTextMessage': {
            'LanguageCode': 'string',
            'Text': 'string',
            'VoiceId': 'string'
        },
        'SSMLMessage': {
            'LanguageCode': 'string',
            'Text': 'string',
            'VoiceId': 'string'
        }
    },
    DestinationPhoneNumber='string',
    OriginationPhoneNumber='string'
)
Parameters:
  • CallerId (string) – The phone number that appears on recipients’ devices when they receive the message.

  • ConfigurationSetName (string) – The name of the configuration set that you want to use to send the message.

  • Content (dict) –

    An object that contains a voice message and information about the recipient that you want to send it to.

    • CallInstructionsMessage (dict) – An object that defines a message that contains text formatted using Amazon Pinpoint Voice Instructions markup.

      • Text (string) – The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.

    • PlainTextMessage (dict) – An object that defines a message that contains unformatted text.

      • LanguageCode (string) – The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.

      • Text (string) – The plain (not SSML-formatted) text to deliver to the recipient.

      • VoiceId (string) – The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.

    • SSMLMessage (dict) – An object that defines a message that contains SSML-formatted text.

      • LanguageCode (string) – The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.

      • Text (string) – The SSML-formatted text to deliver to the recipient.

      • VoiceId (string) – The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.

  • DestinationPhoneNumber (string) – The phone number that you want to send the voice message to.

  • OriginationPhoneNumber (string) – The phone number that Amazon Pinpoint should use to send the voice message. This isn’t necessarily the phone number that appears on recipients’ devices when they receive the message, because you can specify a CallerId parameter in the request.

Return type:

dict

Returns:

Response Syntax

{
    'MessageId': 'string'
}

Response Structure

  • (dict) – SendVoiceMessageResponse

    • MessageId (string) – A unique identifier for the voice message.

Exceptions

  • PinpointSMSVoice.Client.exceptions.TooManyRequestsException

  • PinpointSMSVoice.Client.exceptions.BadRequestException

  • PinpointSMSVoice.Client.exceptions.InternalServiceErrorException