Example of sending a template message in AWS End User Messaging Social - AWS End User Messaging Social

Example of sending a template message in AWS End User Messaging Social

The following example shows how to use a template to send a message to your customer using the AWS CLI. For more information on configuring the AWS CLI, see Configure the AWS CLI in the AWS Command Line Interface User Guide.

aws socialmessaging send-whatsapp-message --message '{"messaging_product":"whatsapp","to":"'{PHONE_NUMBER}'","type":"template","template":{"name":"statement","language":{"code":"en_US"},"components":[{"type":"body","parameters":[{"type":"text","text":"1000"}]}]}}' --origination-phone-number-id {ORIGINATION_PHONE_NUMBER_ID} --meta-api-version v20.0

In the preceding command, do the following:

  • Replace {PHONE_NUMBER} with your customer's phone number.

  • Replace {ORIGINATION_PHONE_NUMBER_ID} with your phone number's ID.