Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Go to Haptik Website
  • Contact Us
  • Home
  • Deployment
  • WhatsApp

How to setup WhatsApp message templates?

Written by Medha Anand

Updated on October 12th, 2022

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
    Build Deploy Analyse Manage Account Bot Deactivation
  • Bot Building
    Essentials Smart Skills Steps User Messages Bot Responses Entities Connections Customisations User feedback collection Testing Whatsapp Bots NLU
  • Conversation Design
    Design Basics Design Guides Designing for Platforms Designing WhatsApp Bots
  • Developer Guides
    Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration
  • Deployment
    Web SDK WhatsApp Facebook Instagram Sunshine Conversation LINE Google Business Messages Telegram MS Teams Bot as an API iOS SDK Android SDK
  • Agent Setup
    Haptik's Smart Agent Chat Zendesk Chat Salesforce Service Cloud Freshchat Zoho NICE CXOne Gorgias
  • Analytics & Reporting
    Intelligent Analytics
  • Proactive Messaging
    WhatsApp Notifications & Templates Team and User Management APIs and Integrations SMS Notifications Embedded Signup Proactive Messaging Attribution
  • Commerce Plus
    Commerce Plus for Instagram Commerce Plus for Facebook Catalog Localization
  • Troubleshooting Guides
    Error Messages FAQs
  • Release Notes
+ More

You can have the bot initiate a conversation with the user. This is done by sending them a pre-approved message template, previously called HSM.

WhatsApp Message Templates

Message templates are messages with placeholders for sending dynamic data. All templates need to be approved by WhatsApp before they can be sent to the user.

You can read more about the WhatsApp message template here.

Here’s a sample message template:

Delete

Hi {{1}}! Thanks for starting your personal training plan. We’ll send you a {{2}} update with your new schedule. You can log in online using your training ID {{3}}. Stay fit!

After filling in user-specific data the message template will be sent out as:

Hi Joey! Thanks for starting your personal training plan. We’ll send you a weekly update with your new schedule. You can log in online using your training ID 123456. Stay fit!

How to send Message Templates?

There are 2 major steps involved in this process:

Step 1 - Create a message template

The first step is to create a message template according to WhatsApp guidelines and request approval. Only approved messages can be sent to users and the approval process can take 1-2 weeks. You can read more about creating message templates here.

At any time, you can send message templates to customers who have opted-in. You can read more about business-initiated messages here and opt-ins here.

Step 2 - Send the message template

When the business wants to send a message template, they make an API request to Conversation Studio with the WhatsApp number, the template id, and the data to be filled in the template. Conversation Studio then fetches the WhatsApp id for the number and if that is found, it sends a request to the WhatsApp server instance with the template id, WhatsApp id, and the data for the template. The WhatsApp server instance then sends the message template to the user.

Delete

Note: 

Whatsapp has deprecated the older version of "send notification API" (/whatsapp/notification/). If you are still using it, we would recommend transitioning to (/whatsapp/notification/v2) as soon as possible. Haptik will also be deprecating it by the end of April 2022. 


API REQUEST

The default request signature for sending a text message is as shown below. To send other types of messages, you can read here.

In the request body, business_id, token, account_id, and template details will be provided by Haptik.

curl --location --request POST <BASE_URL>/whatsapp/notification/v2/' \
--header 'Content-Type: application/json' \
--header 'Account-Id: <Account_Id>' \
--header 'Authorization: Bearer <authentication_token>' \
--data-raw '{
    "business_id":<ID of the business as a number>,
    "to":<phone_number>,
    "type":"template",
    "template":{
        "namespace":<from whatsapp dashboard>,
        "name":<name of the template>,
        "language":{
            "policy":"deterministic",
            "code":"en"
        },
         "components": [{
            "type": "body",
            "parameters": [
                {
                    "type": "text",
                    "text": "<Param 1 value>"
                }      
            ]
        }] 
    }
}'
Delete

You will have to add Base URL, Account ID, and Token in their respective fields in the code above. 

For Account ID, you will have to navigate to your bot > Business Manager > Channels > Platform Deployments, select WhatsApp under the platform dropdown, and click on View Credentials, as shown.

The Base URL and Token, you will get from the Platform Deployments itself. 

API RESPONSE

When the API call is successful, you will get the below response. This means the Notifications API was triggered and WhatsApp sent the message to a defined number. The delivery to the recipient is not guaranteed by WhatsApp.

{
    "meta": {
        "api_status": "stable",
        "version": "<whatsapp version>"
    },
    "messages": [{
        "id": "<random message id>"
    }]
}


When the API call is unsuccessful, you will get the below response. You can refer to this for getting more information on the error received. 

{
    "meta": {
        "api_status": "stable",
        "version": "<whatsapp version>"
    },
    "errors": [
        {
            "code": <error code>,
            "title": "<code title>",
            "details": "<error details>"
        }
    ]
}

FAQs

1. I keep getting "unable to verify contact details" in response even though the Mobile Number entered is a valid WhatsApp account. This could happen because of the following reasons:

  • If the credentials entered in your Bot's Business Manager are incorrect.
  • If you have not specified the Country code in the to field when sending the message template and if it is different from the Country Code used when setting up the WhatsApp Number.

2. What are the acceptable formats for phone numbers?

    You can read here about all the acceptable formats.

3. Where do I check the message statistics?

    Sent vs Delivered messages statistics are available on the WhatsApp dashboard.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • How to deploy Haptik's bot on Whatsapp?
  • Steps to create a WhatsApp Bot
  • Introduction to WhatsApp Bots
  • How to take WhatsApp bot live?

Platform

  • Conversation Studio
  • Smart Skills
  • Advanced NLU
  • Intelligent Analytics
  • Omnichannel
  • Smart Agent Chat
  • Enterprise Security
  • Integrations

Solutions

  • Conversational Commerce
  • Lead Generation
  • Customer Care
  • WhatsApp
  • Conversational IVR
  • Google Business Messages

Industries

  • Retail/ E-Commerce
  • Financial Services
  • Travel & Hospitality
  • Telecom

Knowledge

  • ROI Calculator
  • Reports & Research
  • Case Studies
  • Webinars
  • ISAT
  • Tech Blog
  • Business Blog
  • Resources
  • Haptik v/s Yellow
  • Haptik v/s Liveperson
  • Haptik v/s IBM Watson
  • Haptik v/s Verloop
  • Conversations on AI

Company

  • Why Haptik
  • About Us
  • Careers
  • News & Media
  • Awards & Recognition
  • Contact Us
  • Partnerships
  • Investor Relations

Subscribe

Sign up to recieve the latest updates

Find us on

  • Twitter-footer
  • Linkedin-footer
  • YT-footer
  • Insta-footer
  • G2-footer
  • Facebook-footer

Copyright © jio Haptik Technology Limited 2021 | Data Security & Privacy Policy | GDPR

North America | Asia Pacific | Africa | enterprise@haptik.ai

Definition by Author

0
0