Skip to main content

voice_templates

Creates, updates, deletes, gets or lists a voice_templates resource.

Overview

Namevoice_templates
TypeResource
Idaws.pinpoint.voice_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the message template.
bodystringThe text of the script that's used in messages that are based on the message template, in plain text format.
creation_datestringThe date, in ISO 8601 format, when the message template was created.
default_substitutionsstringThe JSON object that specifies the default values that are used for message variables in the message template. This object is a set of key-value pairs. Each key defines a message variable in the template. The corresponding value defines the default value for that variable.
language_codestringThe code for the language that's used when synthesizing the text of the script in messages that are based on the message template. For a list of supported languages and the code for each one, see the Amazon Polly Developer Guide.
last_modified_datestringThe date, in ISO 8601 format, when the message template was last modified.
template_descriptionstringThe custom description of the message template.
template_namestringThe name of the message template.
template_typestringThe type of channel that the message template is designed for. For a voice template, this value is VOICE. (EMAIL, SMS, VOICE, PUSH, INAPP)
versionstringThe unique identifier, as an integer, for the active version of the message template, or the version of the template that you specified by using the version parameter in your request.
voice_idstringThe name of the voice that's used when delivering messages that are based on the message template. For a list of supported voices, see the Amazon Polly Developer Guide.
tagsobjectA string-to-string map of key-value pairs that identifies the tags that are associated with the message template. Each tag consists of a required tag key and an associated tag value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_voice_templateselecttemplate-name, regionversionRetrieves the content and settings of a message template for messages that are sent through the voice channel.
create_voice_templateinserttemplate-name, region, VoiceTemplateRequestCreates a message template for messages that are sent through the voice channel.
update_voice_templateupdatetemplate-name, region, VoiceTemplateRequestcreate-new-version, versionUpdates an existing message template for messages that are sent through the voice channel.
delete_voice_templatedeletetemplate-name, regionversionDeletes a message template for messages that were sent through the voice channel.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
template-namestringThe name of the message template. A template name must start with an alphanumeric character and can contain a maximum of 128 characters. The characters can be alphanumeric characters, underscores (_), or hyphens (-). Template names are case sensitive.
create-new-versionbooleanSpecifies whether to save the updates as a new version of the message template. Valid values are: true, save the updates as a new version; and, false, save the updates to (overwrite) the latest existing version of the template. If you don't specify a value for this parameter, Amazon Pinpoint saves the updates to (overwrites) the latest existing version of the template. If you specify a value of true for this parameter, don't specify a value for the version parameter. Otherwise, an error will occur.
versionstringThe unique identifier for the version of the message template to update, retrieve information about, or delete. To retrieve identifiers and other information for all the versions of a template, use the Template Versions resource. If specified, this value must match the identifier for an existing template version. If specified for an update operation, this value must match the identifier for the latest existing version of the template. This restriction helps ensure that race conditions don't occur. If you don't specify a value for this parameter, Amazon Pinpoint does the following: For a get operation, retrieves information about the active version of the template. For an update operation, saves the updates to (overwrites) the latest existing version of the template, if the create-new-version parameter isn't used or is set to false. For a delete operation, deletes the template, including all versions of the template.

SELECT examples

Retrieves the content and settings of a message template for messages that are sent through the voice channel.

SELECT
arn,
body,
creation_date,
default_substitutions,
language_code,
last_modified_date,
template_description,
template_name,
template_type,
version,
voice_id,
tags
FROM aws.pinpoint.voice_templates
WHERE `template-name` = '{{ template-name }}' -- required
AND region = '{{ region }}' -- required
AND version = '{{ version }}'
;

INSERT examples

Creates a message template for messages that are sent through the voice channel.

INSERT INTO aws.pinpoint.voice_templates (
VoiceTemplateRequest,
`template-name`,
region
)
SELECT
'{{ VoiceTemplateRequest }}' /* required */,
'{{ template-name }}',
'{{ region }}'
RETURNING
create_template_message_body
;

UPDATE examples

Updates an existing message template for messages that are sent through the voice channel.

UPDATE aws.pinpoint.voice_templates
SET
VoiceTemplateRequest = '{{ VoiceTemplateRequest }}'
WHERE
`template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND VoiceTemplateRequest = '{{ VoiceTemplateRequest }}' --required
AND `create-new-version` = {{ create-new-version}}
AND version = '{{ version}}'
RETURNING
message_body;

DELETE examples

Deletes a message template for messages that were sent through the voice channel.

DELETE FROM aws.pinpoint.voice_templates
WHERE `template-name` = '{{ template-name }}' --required
AND region = '{{ region }}' --required
AND version = '{{ version }}'
;