Whatsapp API
  • Getting Started
    • Dashboard API Overview
    • Register WhatsApp Business API Number
    • Get Channel ID & Link Your App
    • Get Access Token
    • Create WhatsApp Template
  • Whatsapp API
    • WhatsApp API's Overview
    • Media
      • Upload Media
      • Download Media
    • Send Messages
      • Text Mesage
      • Reaction Message
      • Media Message
      • Contact Message
      • Interactive Message
      • Template Message
      • Reply Message
    • Mark Message as Read
    • Set-up Webhook
      • Received Messages
      • Message Status
    • Error Codes
Powered by GitBook
On this page
  1. Whatsapp API
  2. Send Messages

Template Message

PreviousInteractive MessageNextReply Message

Last updated 2 years ago

Whatsapp message templates are pre-defined message format used to send notifications or initiate conversations with your customers. Messages can include appointment reminders, shipping information, issue resolution or payment updates. Before sending a message template, you need to create one. See for more information

To send a template message, make POST it to /{{Channel-ID}}/messages and attach a message template object, Whatsapp Business API supports messages of interactive type as in the list below:

  1. Text based message templates

  2. Media based message templates

  3. Interactive Message Templates

A successful response includes an object with an identifier prefixed with wamid. Use the wamid to track your message status.

Text Based Message Templates

{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "{{Recipient-Phone-Number}}",
    "type": "template",
    "template": {
        "name": "template-name",
        "language": {
            "code": "language-and-locale-code"
        },
        "components": [
            {
                "type": "body",
                "parameters": [
                    {
                        "type": "text",
                        "text": "text-string"
                    },
                    {
                        "type": "currency",
                        "currency": {
                            "fallback_value": "$100.99",
                            "code": "USD",
                            "amount_1000": 100990
                        }
                    },
                    {
                        "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"
                        }
                    }
                ]
            }
        ]
    }
}

Media Based Message Templates

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "{{Receipient-Phone-Number}}",
  "type": "template",
  "template": {
    "name": ""template-name",
    "language": {
      "code": "language-and-locale-code"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "link": "https://URL"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "text-string"
          },
          {
            "type": "currency",
            "currency": {
              "fallback_value": "VALUE",
              "code": "USD",
              "amount_1000": NUMBER
            }
          },
          {
            "type": "date_time",
            "date_time": {
              "fallback_value": "MONTH DAY, YEAR"
            }
          }
        ]
      }
    ]
  }
}

Interactive Message Templates

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "template",
  "template": {
    "name": "template_name",
    "language": {
      "code": "language-and-locale-code"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "link": "http(s)://URL"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "text-string"
          },
          {
            "type": "currency",
            "currency": {
              "fallback_value": "VALUE",
              "code": "USD",
              "amount_1000": NUMBER
            }
          },
          {
            "type": "date_time",
            "date_time": {
              "fallback_value": "MONTH DAY, YEAR"
            }
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "0",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "1",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      }
    ]
  }
}

please refer to this as well to see the possible of Template object

Create Message Templates for Your WhatsApp Business Account
document