STOP-LIGHT DOCUMENTATION for Template API

STOP-LIGHT DOCUMENTATION for Template API

                                                        STOP-LIGHT DOCUMENTATION

The released documentation covers how to use APIs to send templates directly from the Marketing panel.

POST   https://connect.api-wa.co/project-apis/v1/project/{project_id}/messages
 
PARAMETER
Project_id : XXX
 
AUTH
X-API-WA-Project-API-Pwd: XXX
 
BODY
To: {Phone number}
Template: name: {template name}
Language: code: {Language code} eg “en” for English
Parameters:
Body
Text
"type": "text",
 "text": "text-string"
Currency
"type": "currency",
            "currency": {
              "fallback_value": "$100.99",
              "code": "USD",
              "amount_1000": 100990
Date and Time
            "type": "date_time",
            "date_time": {
              "fallback_value": "February 25, 1977",
              "day_of_week": 5,
              "year": 1977,
              "month": 2,
              "day_of_month": 25,
              "hour": 15,
              "minute": 33,
              "calendar": "GREGORIAN"
Buttons
Call To Action Buttons
"type": "button",
        "sub_type": {button_sub_type} eg URL here,
        "index": "1", // index of the button, starts from 0
        "parameters": [
          {
            "type": "payload",
            "payload": {dynamic_text_for_button}
          }
        ]
      },

Parameter
Description
POST
 Type of API call
 

Project Id
 Project ID of account
 

Auth
 API token for the Account
 

Phone Number
 Phone number to whom the message needs to be sent
Template name
 Name of the template you created
Language code
 Language code that you selected for the template (en for English)
TEXT PARAMETERS

text
 Text for variable 1 in body replacement
CURRENCY

fallback_value
 Fallback value if there is no currency parameter
code
 Currency used eg USD, INR
amount_1000
 Amount
DATE AND TIME

Fallback_value
 Fallback value if there is no date time parameter
BUTTONS

sub_type
 There are multiple subtypes, eg URL
index
 Index of the button, position, starts from 0
payload
Text value for the variable set in button.


Sample Value:
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "1234567890",
  "type": "template",
  "template": {
    "name": "customer_testing",
    "language": {
      "code": "en"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "UserName"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "URL",
        "index": "1",
        "parameters": [
          {
            "type": "payload",
            "payload": "about"
          }
        ]
      }
    ]
  }
}

Sample Response:
{
    "messaging_product": "whatsapp",
    "contacts": [
        {
            "input": "1234567890",
            "wa_id": "1234567890"
        }
    ],
    "messages": [
        {
            "id": "wamid.HBgMOTE5MDE2NTI",
            "message_status": "accepted"
        }
    ]
}



Explanation:
The format of the payload depends on the template format.
If the template has multiple text variables the parameters for text will increase.
For example,
{
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "UserName"
          },
   {
            "type": "text",
            "text": "CustomerID"
          },
        ]
      }
Here the parameter value will increase depending upon the number of variables in the template.
Same goes for the button. If there are two buttons with variables or dynamic URL link
The subtype and the count will depend upon that.
Also, there are multiple sub-types of buttons such as Catalog, URL and so on.
Following is the list of sub types that are currently supported:
CATALOG
COPY_CODE
FLOW
MPM
ORDER_DETAILS
QUICK_REPLY
REMINDER
URL
Kindly, look at template and select the type accordingly.

    • Related Articles

    • API Documentation

      Running an API in Postman is a straightforward process, but it becomes even more useful when you need to include custom headers and a specific JSON request body. In this guide, we'll walk you through the steps to run the WABA API using Postman with a ...
    • Mastering Template Creation: A Comprehensive Guide

      Mastering Template Creation: A Comprehensive Guide The ability to create templates is a valuable talent in the fast-paced field of communication management as it may assure professionalism, consistency, and time savings. Having well-designed ...
    • Comprehending the Marketing Panel Flows

      Comprehending the Marketing Panel Flows The marketing panel's "Flows" function provides a flexible toolkit for creating dynamic and interactive communications experiences. Let's see how to make the most of this option: Step 1: Obtaining Flows Start ...
    • Exploring Manage Options in Customer Messaging Platforms

      Exploring Manage Options in Customer Messaging Platforms Effective communication management is critical in the field of customer service and engagement. A feature-rich and well-structured management system can increase productivity, simplify ...
    • Mastering Campaign Shoots: A Step-by-Step Guide

      Mastering Campaign Shoots: A Step-by-Step Guide Campaigns are crucial components of marketing strategy because they efficiently reach the target audience and shape the narrative. We'll get into the process of filming a campaign today, working through ...