✉️Messaging

This documentation describes how to start sending messages to your customers.

Introduction

Message API calls are sent to the /v1/messages endpoint regardless of message type, but the content of the JSON message body differs for each type of message type (text, image, etc.). See the following documentation for information regarding the type of messages you want to send.

Send Message

POST https://api.whatso.net/v1/messages

To send a message, use the request URL and the following body parameters.

Request Body

Name
Type
Description

username*

string

Enter username of your account which you will find in WhatsoNxt panel.

password*

string

Enter password of your account which you will find in WhatsoNxt panel.

from*

string

WhatsApp Business Number with Country Code.

to*

string

Recipients Mobile number with Country Code.

type*

string

For approved template message send "template".

template:language*

string

Pass language of your approved template.

name*

string

Pass template name which you entered at time of template creation.

apicomponents:type*

string

Pass body for text variables, header for image, footer for button.

parameters:type*

string

Pass text for text variable in body.

If header has image then pass image.

Pass text in footer.

sub_type

string

If approved template has button in footer then pass url.

index

string

If approved template has button in footer then pass "0".

parameters:value*

string

Pass variable value in body, image link in header, website url in footer.

{
  "responsecode": 200,
  "api_status": "stable",
  "response": "success",
  "message": "success",
  "messageid": "147895"
}

Example 1 - Sending Text Template Message

{
  "username": "AAA1111AAA678AAA9xxxxxxxxxxxxx",
  "password": "AAA2345AAA678AAA9xxxxxxxxxxxxx",
  "from": "918866xxxx",
  "to": "918866xxxx",
  "type": "template",
  "template": {
    "language": {
      "code": "en"
    },
    "name": "template_name",
    "apicomponents": [ ]
  }
}

Example 2 - Sending Text Template Message With Parameters

{
  "username": "AAA1111AAA678AAA9xxxxxxxxxxxxx",
  "password": "AAA2345AAA678AAA9xxxxxxxxxxxxx",
  "from": "918866xxxx",
  "to": "918866xxxx",
  "type": "template",
  "template": {
    "language": {
      "code": "en"
    },
    "name": "template_name",
    "apicomponents": [
    {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "value": "hello"
          },
           {
            "type": "text",
            "value": "123454"
          }
        }
     ]
  }
}

Example 3 - Sending Media Template Message With Parameters

{
  "username": "AAA1111AAA678AAA9xxxxxxxxxxxxx",
  "password": "AAA2345AAA678AAA9xxxxxxxxxxxxx",
  "from": "918866xxxx",
  "to": "918866xxxx",
  "type": "template",
  "template": {
    "language": {
      "code": "en"
    },
    "name": "template_name",
    "apicomponents": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "value": "https://link-to-your-image.jpg"
          }
        ]
      },
       {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "value": "thanks"
          }
        ]
      },
       {
        "type": "button",
        "parameters": [
          {
            "type": "text",
            "value": "https://your-domain-name.com"
          }
        ],
        "sub_type": "url",
        "index": "0"
      }
    ]
  }
}

Last updated