Creating WhatsApp Message templates
Step-by-step process of creating a Whatsapp Message Template using the Touchpoints API.
To create a WhatsApp template there are multiples steps:
Create a Project: A project acts as an entity that houses the messaging template.
Retrieve a Channel Group: Templates are linked to a WABA (WhatsApp Business Account), and the channel group holds a unique ID that identifies the WABA.
Create a Channel Template: This step involves creating the actual messaging template that will be sent.
Activate the Template: This action submits the template to Meta for approval.
Checking the Template status: Check the current status of the template
Once the template is activate it (approved by Meta), it can be used for sending messages by following the step here.
Before starting this guide make sure you have API Access and you are using the necessary Access Policies and Roles on your Access Key.
Lets go through each of the steps in greater details.
1- Create a project
This will create a Message Template project where the WhatsApp template will be added to.
To create a project, follow these steps:
Make a
POST
request to the/workspaces/{workspaceId}/projects
endpoint.Provide the necessary request body parameters, such as the project name, description, and type.
Message Templates are referred to as channel templates through the API. In this case, we need to set the project type to"channelTemplate"
Example request
scope
Select 3 as Meta requires this template to be sent for review.
suites
select the suite where this template will be used
name
Unique project name
Example response
Upon successful creation, you will receive a response with the details of the newly created project, including the project ID.
2- Retrieve channel group
Use the endpoint below to retrieve all channel groups associated with your WABAs. Select the channel group you wish to use for creating a template. Keep in mind that templates are linked to a specific WABA.
Example response
id
This is the channel group ID required for future calls. It has a one-to-one relationship with your WABA.
platformGroupId
This is a WABA ID
platformGroupName
This is the WABA name
channelIds
List of channels associated to given WABA
3 - Create a Channel Template
This is the actual creation of the WhatsApp template.
Once you have created a project, you can add a channel template to it. Follow these steps:
Make a
POST
request to the/workspaces/{workspaceId}/projects/{projectId}/channel-templates
endpoint.Pass the project ID and other required parameters in the request.
Create a channel template example request
defaultLocale
This locale will be used as a fallback if the locale specified for content is not supported.
platformContent
This is the content that is specific to a platform, in this case, we are adding content for Whatsapp. In the Blocks Documentation section, there is more info on the type of blocks you can add as content. Here is important to specify your channelGroupIds array with the corresponding ID. For more information about channel groups visit the Channels API reference.
variables
List of variables to be used in a template.
supportedPlatforms
Platforms where this template can be used. Since this message is just meant to be used in Whatsapp, we will just include this platform.
deployments
Information about the template used by Whatsapp on deployment. You can read more about Whatsapp templates here.
platformContent.channelGroupIds
Channel group id obtained on the previous API call which relates to yourn WABA
deployments.whatsappAllowCategoryChange
Default: false If set to true, Meta will assign a category based on their template guidelines. If omitted, the template will not be automatically categorized and may be rejected if it is deemed miscategorized.
deployments.whatsappTemplateName
This is the name of the template that will be registered with Meta
If successful, you will receive a response containing the details of the newly created channel template, including its ID. The template will have a status of Draft.
platformContent: This defines the template structure, referred to as "blocks." The structure of this object varies depending on the type of template you're creating. On the subpage, you'll find examples of different block types and their combinations.
Response
projectId
The project ID is required when sending a template message via channels API
status
Draft indicates the template has been created and the next step is to activate it
id
Template id. Required to be use on the next steps to activate the template
On the above screenshot we can see the recent created template on our Bird CRM UI (Message Templates).
4 - Activate template
After creating the WhatsApp Message Template, you need to activate it to make it available for use. Follow these steps:
Make a
PUT
request to the/workspaces/{workspaceId}/projects/{projectId}/channel-templates/{channelTemplateId}/activate
endpoint.Pass the workspace ID, project ID, and channel template ID in the request URL.
Send the request.
Please note that the exact details and procedures of the WhatsApp approval process may vary, and it's recommended to refer to WhatsApp's official documentation. If the approval is successful the message template will be marked as active and will be ready to use.
5 - Checking the status
Last updated