:doc:`PinpointSMSVoice <../../pinpoint-sms-voice>` / Client / send_voice_message

******************
send_voice_message
******************



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-2018-09-05/SendVoiceMessage>`_  


  **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'
    )
    
  :type CallerId: string
  :param CallerId: The phone number that appears on recipients' devices when they receive the message.

  
  :type ConfigurationSetName: string
  :param ConfigurationSetName: The name of the configuration set that you want to use to send the message.

  
  :type Content: dict
  :param Content: 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.

      
    
  
  :type DestinationPhoneNumber: string
  :param DestinationPhoneNumber: The phone number that you want to send the voice message to.

  
  :type OriginationPhoneNumber: string
  :param OriginationPhoneNumber: 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.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'MessageId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* SendVoiceMessageResponse
      

      - **MessageId** *(string) --* A unique identifier for the voice message.
  
  **Exceptions**
  
  *   :py:class:`PinpointSMSVoice.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`PinpointSMSVoice.Client.exceptions.BadRequestException`

  
  *   :py:class:`PinpointSMSVoice.Client.exceptions.InternalServiceErrorException`

  