Templates - Amazon Pinpoint

Templates

A message template is a set of content and settings that you can define, save, and reuse in email messages, push notifications, SMS text messages, and voice messages for any of your Amazon Pinpoint applications.

When you create a message template, you specify the content and settings that you want to reuse in various components of messages that are based on the template. These components, referred to as template parts, can be the message title or subject, the message body, or both, depending on the message type. A template part can also be a channel-specific setting, such as an image to display or a sound to play when a recipient receives a message that's based on the template. When you send a message that’s based on a template, Amazon Pinpoint populates the message with the content and settings that you defined in the template.

The Templates resource represents the repository of message templates that are associated with your Amazon Pinpoint account. You can use this resource to retrieve information about all the message templates that are associated with your account. To retrieve information about versions of a specific message template, use the Template Versions resource.

URI

/v1/templates

HTTP methods

GET

Operation ID: ListTemplates

Retrieves information about all the message templates that are associated with your Amazon Pinpoint account.

Header parameters
NameTypeRequiredDescription
acceptStringFalse

Indicates which content types, expressed as MIME types, the client understands.

Query parameters
NameTypeRequiredDescription
page-sizeStringFalse

The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics.

next-tokenStringFalse

The string that specifies which page of results to return in a paginated response. This parameter is not supported for application, campaign, and journey metrics.

prefixStringFalse

The substring to match in the names of the message templates to include in the results. If you specify this value, Amazon Pinpoint returns only those templates whose names begin with the value that you specify.

template-typeStringFalse

The type of message template to include in the results. Valid values are: EMAIL, PUSH, SMS, and VOICE. To include all types of templates in the results, don't include this parameter in your request.

Responses
Status codeResponse modelDescription
200TemplatesResponse

The request succeeded.

400MessageBody

The request contains a syntax error (BadRequestException).

403MessageBody

The request was denied because access to the specified resource is forbidden (ForbiddenException).

405MessageBody

The request failed because the method is not allowed for the specified resource (MethodNotAllowedException).

409MessageBody

The request failed due to a conflict with the current state of the specified resource (ConflictException).

429MessageBody

The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException).

500MessageBody

The request failed due to an unknown internal server error, exception, or failure (InternalServerErrorException).

OPTIONS

Retrieves information about the communication requirements and options that are available for the Templates resource.

Responses
Status codeResponse modelDescription
200None

The request succeeded.

Schemas

Response bodies

{ "Item": [ { "CreationDate": "string", "LastModifiedDate": "string", "TemplateType": enum, "TemplateName": "string", "TemplateDescription": "string", "DefaultSubstitutions": "string", "Version": "string", "tags": { }, "Arn": "string" } ], "NextToken": "string" }
{ "RequestID": "string", "Message": "string" }

Properties

MessageBody

Provides information about an API request or response.

PropertyTypeRequiredDescription
Message

string

False

The message that's returned from the API.

RequestID

string

False

The unique identifier for the request or response.

TemplateResponse

Provides information about a message template that's associated with your Amazon Pinpoint account.

PropertyTypeRequiredDescription
Arn

string

False

The Amazon Resource Name (ARN) of the message template. This value isn't included in a TemplateResponse object. To retrieve the ARN of a template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate operation, depending on the type of template that you want to retrieve the ARN for.

CreationDate

string

True

The date, in ISO 8601 format, when the message template was created.

DefaultSubstitutions

string

False

The JSON object that specifies the default values that are used for message variables in the message template. This object isn't included in a TemplateResponse object. To retrieve this object for a template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate operation, depending on the type of template that you want to retrieve the object for.

LastModifiedDate

string

True

The date, in ISO 8601 format, when the message template was last modified.

tags

object

False

A map of key-value pairs that identifies the tags that are associated with the message template. This object isn't included in a TemplateResponse object. To retrieve this object for a template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate operation, depending on the type of template that you want to retrieve the object for.

TemplateDescription

string

False

The custom description of the message template. This value isn't included in a TemplateResponse object. To retrieve the description of a template, use the GetEmailTemplate, GetPushTemplate, GetSmsTemplate, or GetVoiceTemplate operation, depending on the type of template that you want to retrieve the description for.

TemplateName

string

True

The name of the message template.

TemplateType

string

Values: EMAIL | SMS | VOICE | PUSH | INAPP

True

The type of channel that the message template is designed for. Possible values are: EMAIL, PUSH, SMS, INAPP, and VOICE.

Version

string

False

The unique identifier, as an integer, for the active version of the message template.

TemplatesResponse

Provides information about all the message templates that are associated with your Amazon Pinpoint account.

PropertyTypeRequiredDescription
Item

Array of type TemplateResponse

True

An array of responses, one for each message template that's associated with your Amazon Pinpoint account and meets any filter criteria that you specified in the request.

NextToken

string

False

The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.

See also

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

ListTemplates