SendVoiceMessage - Amazon Pinpoint SMS and Voice v2 API

SendVoiceMessage

Allows you to send a request that sends a voice message through Amazon Pinpoint. This operation uses Amazon Polly to convert a text script into a voice message.

Request Syntax

{ "ConfigurationSetName": "string", "Context": { "string" : "string" }, "DestinationPhoneNumber": "string", "DryRun": boolean, "MaxPricePerMinute": "string", "MessageBody": "string", "MessageBodyTextType": "string", "OriginationIdentity": "string", "TimeToLive": number, "VoiceId": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ConfigurationSetName

The name of the configuration set to use. This can be either the ConfigurationSetName or ConfigurationSetArn.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [A-Za-z0-9_:/-]+

Required: No

Context

You can specify custom data in this field. If you do, that data is logged to the event destination.

Type: String to string map

Map Entries: Minimum number of 0 items. Maximum number of 5 items.

Key Length Constraints: Minimum length of 1. Maximum length of 100.

Key Pattern: \S+

Value Length Constraints: Minimum length of 1. Maximum length of 800.

Value Pattern: (?!\s)^[\s\S]+(?<!\s)

Required: No

DestinationPhoneNumber

The destination phone number in E.164 format.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 20.

Pattern: \+?[1-9][0-9]{1,18}

Required: Yes

DryRun

When set to true, the message is checked and validated, but isn't sent to the end recipient.

Type: Boolean

Required: No

MaxPricePerMinute

The maximum amount to spend per voice message, in US dollars.

Type: String

Length Constraints: Minimum length of 2. Maximum length of 8.

Pattern: [0-9]{0,2}\.[0-9]{1,5}

Required: No

MessageBody

The text to convert to a voice message.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6000.

Pattern: (?!\s*$)[\s\S]+

Required: No

MessageBodyTextType

Specifies if the MessageBody field contains text or speech synthesis markup language (SSML).

  • TEXT: This is the default value. When used the maximum character limit is 3000.

  • SSML: When used the maximum character limit is 6000 including SSML tagging.

Type: String

Valid Values: TEXT | SSML

Required: No

OriginationIdentity

The origination identity to use for the voice call. This can be the PhoneNumber, PhoneNumberId, PhoneNumberArn, PoolId, or PoolArn.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [A-Za-z0-9_:/\+-]+

Required: Yes

TimeToLive

How long the voice message is valid for. By default this is 72 hours.

Type: Integer

Valid Range: Minimum value of 5. Maximum value of 259200.

Required: No

VoiceId

The voice for the Amazon Polly service to use. By default this is set to "MATTHEW".

Type: String

Valid Values: AMY | ASTRID | BIANCA | BRIAN | CAMILA | CARLA | CARMEN | CELINE | CHANTAL | CONCHITA | CRISTIANO | DORA | EMMA | ENRIQUE | EWA | FILIZ | GERAINT | GIORGIO | GWYNETH | HANS | INES | IVY | JACEK | JAN | JOANNA | JOEY | JUSTIN | KARL | KENDRA | KIMBERLY | LEA | LIV | LOTTE | LUCIA | LUPE | MADS | MAJA | MARLENE | MATHIEU | MATTHEW | MAXIM | MIA | MIGUEL | MIZUKI | NAJA | NICOLE | PENELOPE | RAVEENA | RICARDO | RUBEN | RUSSELL | SALLI | SEOYEON | TAKUMI | TATYANA | VICKI | VITORIA | ZEINA | ZHIYU

Required: No

Response Syntax

{ "MessageId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

MessageId

The unique identifier for the message.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The request was denied because you don't have sufficient permissions to access the resource.

HTTP Status Code: 400

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.

HTTP Status Code: 400

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.

HTTP Status Code: 500

ResourceNotFoundException

A requested resource couldn't be found.

HTTP Status Code: 400

ServiceQuotaExceededException

The request would cause a service quota to be exceeded.

HTTP Status Code: 400

ThrottlingException

An error that occurred because too many requests were sent during a certain amount of time.

HTTP Status Code: 400

ValidationException

A validation exception for a field.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: