OneRoute
  • Introduction
  • Prerequisites
  • Whatsapp API
    • Sandbox (Test API Key)
    • Getting Started
    • Endpoints
      • Fetch Channels
      • Fetch Channel Templates
      • Send Template Message
      • Send Campaign Message
      • Send Session Message
    • FAQ
  • EMAIL API
    • Getting Started
    • Endpoints
      • Fetch Email Channels
      • Send Email to Customers
  • SMS API
    • Getting Started
    • Endpoints
      • Fetch SMS Channels
      • Send SMS to Customers
      • Send OTP SMS to Customers
      • Fetch SMS Messages
      • Get SMS DLR Message
  • ONEOTP API
    • Getting Started
    • Endpoints
      • Fetch OTP Templates
      • Send OTP
      • Verify OTP
  • EMBED
    • Getting Started
    • Installation
    • Push Notification
  • OTHERS
    • Receiving Events - Webhooks
    • Fetch Channel By Id
    • Fetch Logs
Powered by GitBook
On this page
  • Send WhatsApp Template Message
  • Example Request Payload
  • Example Request Payload (Authentication Template)

Was this helpful?

  1. Whatsapp API
  2. Endpoints

Send Template Message

Send WhatsApp Template Message

POST https://api.oneroute.io/api/public/conversation/template

Template messages can be delivered at any time. Each template needs to be registered and pre-approved by WhatsApp

Headers

Name
Type
Description

apiKey

string

API Key for authentication.

Request Body

Name
Type
Description

messages.*.save

boolean

To save the message as a conversation on OneRoute or not.

messages.*.template

object

The template object

messages

array

An array of messages to send

from

string

messages.*.to

string

Whatsapp number to send template message to.

messages.*.template.name

string

the template name

{
    "data": [
        {
            "status": "success",
            "response": "gBGHI0kFNWAgTwIJk-_rr1Kse2yO"
        }
    ],
    "message": "Message sent to customer",
    "success": true
}
{
    "data": null,
    "success": false,
    "message": "\"template\" is required"
}
{
    "data": null,
    "message": "Invalid API Key",
    "success": false
}

Example Request Payload

{
    "messages": [
        {
            "template": {
                "name": "first_welcome_messsage",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Michael"
                    }
                ] // leave the array empty if no placeholders in the template
            },
            "to": "234XXXXXXXX",
            "save": true
        },
                {
            "template": {
                "name": "new_conversation",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Timothy"
                    }
                ] // leave the array empty if no placeholders in the template
            },
            "to": "234XXXXXXXX",
            "save": true
        }
    ],
    "from": "234XXXXXXXX"
}

Example Request Payload (Authentication Template)

{
    "messages": [
        {
            "template": {
                "name": "first_welcome_messsage",
                "parameters": [
                    {
                        "type": "text",
                        "text": "OTP CODE"
                    }
                ],
                "buttons": [
                    {
                        "type": "text",
                        "text": "OTP CODE"
                    }
                ]
            },
            "to": "234XXXXXXXX",
            "save": true
        }
    ],
    "from": "234XXXXXXXX"
}
PreviousFetch Channel TemplatesNextSend Campaign Message

Last updated 6 months ago

Was this helpful?