Skip to main content

whats_app_message_templates

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

Overview

Namewhats_app_message_templates
TypeResource
Idaws.socialmessaging.whats_app_message_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
templatestringThe complete template definition as a JSON string (maximum 6000 characters).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_whats_app_message_templateselectid, regionmetaTemplateId, templateName, templateLanguageCodeRetrieves a specific WhatsApp message template.
create_whats_app_message_templateinsertregion, templateDefinition, idCreates 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_libraryinsertregion, metaLibraryTemplate, idCreates a new WhatsApp message template using a template from Meta's template library.
create_whats_app_message_template_mediainsertregion, idUploads media for use in a WhatsApp message template.
update_whats_app_message_templateupdateregion, idUpdates an existing WhatsApp message template.
delete_whats_app_message_templatedeleteid, templateName, regionmetaTemplateId, deleteAllTemplatesDeletes a WhatsApp message template.
list_whats_app_message_templatesexecid, regionnextToken, maxResultsLists 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.

NameDatatypeDescription
idstringThe ID of the WhatsApp Business Account to list templates for.
regionstringAWS region (default: us-east-1)
templateNamestringThe name of the template to delete.
deleteAllTemplatesbooleanIf true, deletes all language versions of the template.
maxResultsintegerThe maximum number of results to return per page (1-100).
metaTemplateIdstringThe numeric ID of the template assigned by Meta.
nextTokenstringThe token for the next page of results.
templateLanguageCodestringThe 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.
templateNamestringThe name of the message template. Use together with templateLanguageCode as an alternative to metaTemplateId to identify a template.

SELECT examples

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

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
;

UPDATE examples

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

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

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 }}'
;