Creating your first Whatsapp Message Template
Step-by-step process of creating a Whatsapp Message Template using the Touchpoints API.
WhatsApp approved
Before starting this guide make sure you have API Access and you are using the necessary Access Policies and Roles on your Access Key.
Step 1: Create a project
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"
Upon successful creation, you will receive a response with the details of the newly created project, including the project ID.
Step 2: Add a Channel 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.
Request Payload
Default Locale
This locale will be used as a fallback if the locale specified for content is not supported.
Generic Content
This content only applies to omnichannel templates, so no need to set it in this case.
Platform Content
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.
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.
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.
Step 3: Activate the 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.
Step 4: Checking the status
If for any reason the previous message template is rejected by Whatsapp you will see its status as inactive. In the body of the response you can find the reason for rejection:
Last updated