whats_app_message_templates
Creates, updates, deletes, gets or lists a whats_app_message_templates resource.
Overview
| Name | whats_app_message_templates |
| Type | Resource |
| Id | aws.socialmessaging.whats_app_message_templates |
Fields
The following fields are returned by SELECT queries:
- get_whats_app_message_template
| Name | Datatype | Description |
|---|---|---|
template | string | The complete template definition as a JSON string (maximum 6000 characters). |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_whats_app_message_template | select | id, region | metaTemplateId, templateName, templateLanguageCode | Retrieves a specific WhatsApp message template. |
create_whats_app_message_template | insert | region, templateDefinition, id | Creates a new WhatsApp message template from a custom definition. Amazon Web Services End User Messaging Social does not store any WhatsApp message template content. | |
create_whats_app_message_template_from_library | insert | region, metaLibraryTemplate, id | Creates a new WhatsApp message template using a template from Meta's template library. | |
create_whats_app_message_template_media | insert | region, id | Uploads media for use in a WhatsApp message template. | |
update_whats_app_message_template | update | region, id | Updates an existing WhatsApp message template. | |
delete_whats_app_message_template | delete | id, templateName, region | metaTemplateId, deleteAllTemplates | Deletes a WhatsApp message template. |
list_whats_app_message_templates | exec | id, region | nextToken, maxResults | Lists WhatsApp message templates for a specific WhatsApp Business Account. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the WhatsApp Business Account to list templates for. |
region | string | AWS region (default: us-east-1) |
templateName | string | The name of the template to delete. |
deleteAllTemplates | boolean | If true, deletes all language versions of the template. |
maxResults | integer | The maximum number of results to return per page (1-100). |
metaTemplateId | string | The numeric ID of the template assigned by Meta. |
nextToken | string | The token for the next page of results. |
templateLanguageCode | string | The language code of the message template (for example, en or en_US). Use together with templateName as an alternative to metaTemplateId to identify a template. |
templateName | string | The name of the message template. Use together with templateLanguageCode as an alternative to metaTemplateId to identify a template. |
SELECT examples
- get_whats_app_message_template
Retrieves a specific WhatsApp message template.
SELECT
template
FROM aws.socialmessaging.whats_app_message_templates
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
AND metaTemplateId = '{{ metaTemplateId }}'
AND templateName = '{{ templateName }}'
AND templateLanguageCode = '{{ templateLanguageCode }}'
;
INSERT examples
- create_whats_app_message_template
- create_whats_app_message_template_from_library
- create_whats_app_message_template_media
- Manifest
Creates a new WhatsApp message template from a custom definition. Amazon Web Services End User Messaging Social does not store any WhatsApp message template content.
INSERT INTO aws.socialmessaging.whats_app_message_templates (
templateDefinition,
id,
region
)
SELECT
'{{ templateDefinition }}' /* required */,
'{{ id }}' /* required */,
'{{ region }}'
RETURNING
category,
meta_template_id,
template_status
;
Creates a new WhatsApp message template using a template from Meta's template library.
INSERT INTO aws.socialmessaging.whats_app_message_templates (
metaLibraryTemplate,
id,
region
)
SELECT
'{{ metaLibraryTemplate }}' /* required */,
'{{ id }}' /* required */,
'{{ region }}'
RETURNING
category,
meta_template_id,
template_status
;
Uploads media for use in a WhatsApp message template.
INSERT INTO aws.socialmessaging.whats_app_message_templates (
id,
sourceS3File,
region
)
SELECT
'{{ id }}' /* required */,
'{{ sourceS3File }}',
'{{ region }}'
RETURNING
meta_header_handle
;
# Description fields are for documentation purposes
- name: whats_app_message_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the whats_app_message_templates resource.
- name: templateDefinition
value: "{{ templateDefinition }}"
- name: id
value: "{{ id }}"
- name: metaLibraryTemplate
description: |
Represents a template from Meta's library with customization options.
value:
templateName: "{{ templateName }}"
libraryTemplateName: "{{ libraryTemplateName }}"
templateCategory: "{{ templateCategory }}"
templateLanguage: "{{ templateLanguage }}"
libraryTemplateButtonInputs:
- type_: "{{ type_ }}"
phoneNumber: "{{ phoneNumber }}"
url: "{{ url }}"
otpType: "{{ otpType }}"
zeroTapTermsAccepted: {{ zeroTapTermsAccepted }}
supportedApps: "{{ supportedApps }}"
libraryTemplateBodyInputs:
addContactNumber: {{ addContactNumber }}
addLearnMoreLink: {{ addLearnMoreLink }}
addSecurityRecommendation: {{ addSecurityRecommendation }}
addTrackPackageLink: {{ addTrackPackageLink }}
codeExpirationMinutes: {{ codeExpirationMinutes }}
- name: sourceS3File
description: |
Contains information for the S3 bucket that contains media files.
value:
bucketName: "{{ bucketName }}"
key: "{{ key }}"
UPDATE examples
- update_whats_app_message_template
Updates an existing WhatsApp message template.
UPDATE aws.socialmessaging.whats_app_message_templates
SET
id = '{{ id }}',
metaTemplateId = '{{ metaTemplateId }}',
templateName = '{{ templateName }}',
templateLanguageCode = '{{ templateLanguageCode }}',
parameterFormat = '{{ parameterFormat }}',
templateCategory = '{{ templateCategory }}',
templateComponents = '{{ templateComponents }}',
ctaUrlLinkTrackingOptedOut = {{ ctaUrlLinkTrackingOptedOut }}
WHERE
region = '{{ region }}' --required
AND id = '{{ id }}' --required;
DELETE examples
- delete_whats_app_message_template
Deletes a WhatsApp message template.
DELETE FROM aws.socialmessaging.whats_app_message_templates
WHERE id = '{{ id }}' --required
AND templateName = '{{ templateName }}' --required
AND region = '{{ region }}' --required
AND metaTemplateId = '{{ metaTemplateId }}'
AND deleteAllTemplates = '{{ deleteAllTemplates }}'
;
Lifecycle Methods
- list_whats_app_message_templates
Lists WhatsApp message templates for a specific WhatsApp Business Account.
EXEC aws.socialmessaging.whats_app_message_templates.list_whats_app_message_templates
@id='{{ id }}' --required,
@region='{{ region }}' --required,
@nextToken='{{ nextToken }}',
@maxResults='{{ maxResults }}'
;