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.
Name | Type | Required | Description |
---|---|---|---|
accept | String | False | Indicates which content types, expressed as MIME types, the client understands. |
Name | Type | Required | Description |
---|---|---|---|
page-size | String | False | 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-token | String | False | The |
prefix | String | False | 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-type | String | False | The type of message template to include in the results. Valid values are:
|
Status code | Response model | Description |
---|---|---|
200 | TemplatesResponse | The request succeeded. |
400 | MessageBody | The request contains a syntax error (BadRequestException). |
403 | MessageBody | The request was denied because access to the specified resource is forbidden (ForbiddenException). |
405 | MessageBody | The request failed because the method is not allowed for the specified resource (MethodNotAllowedException). |
409 | MessageBody | The request failed due to a conflict with the current state of the specified resource (ConflictException). |
429 | MessageBody | The request failed because too many requests were sent during a certain amount of time (TooManyRequestsException). |
500 | MessageBody | 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.
Status code | Response model | Description |
---|---|---|
200 | None | 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" }
Properties
MessageBody
Provides information about an API request or response.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
Arn | string | False | The Amazon Resource Name (ARN) of the message template. This value isn't
included in a |
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
|
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 |
TemplateDescription | string | False | The custom description of the message template. This value isn't included in a
|
TemplateName | string | True | The name of the message template. |
TemplateType | string Values: | True | The type of channel that the message template is designed for. Possible values
are: |
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.
Property | Type | Required | Description |
---|---|---|---|
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: