Cunnekt Whatsapp Business API

Cunnekt Whatsapp API allows you to automate notifications, replies, and other integrations with your platform. To get started, you need to have an active plan with API feature.

Base URL:

The default base URL for Cunnekt Messaging API is: https://app2.cunnekt.com/v1

API-KEY:

Endpoints of this API need to be accessed by providing API-KEY in the header. You can generate API Key from Cunnekt API Settings page.

Sending a Template Message

A message template is required for the Business to start a new conversation with a User. This is required if there was no interaction between the accounts previously or if the last message sent by the User has more than 24h.

POST: https://app2.cunnekt.com/v1/sendnotification

Parameters:

Body

mobile

string

Whatsapp Number

templateid

string

Template ID

Cunnekt makes it easier for developers to send template messages via Dynamic Payload available on Template List page for every new template that gets approved. You will see the API Payload option with  </> icon, clicking on which gives you a sample payload for that particular template.

Example 1  – Sending Basic Text Template Message

{

    “mobile”: “wa_id”,

    “templateid”: “template_id”

}

Note: Template ID value is available in Payload Details on Template List Page

Sample

{

    “mobile”: “919000000000”,

    “templateid”: “asdasdfvFFsd42”

}

Example 2  – Sending Template Message with Parameters

Parameters can be header image/video/document and variables in your body or button.

{

    “mobile”: “wa_id”,

    “templateid”: “template_id”,

    “template”: {

        “components”: [{

                “type”: “header”,

                “parameters”: [{

                        “type”: “image”,

                        “image”: {

                            “link”: “https://link-to-your-image.jpg”

                        }

                    }

                ]

            }, {

                “type”: “body”,

                “parameters”: [{

                        “type”: “text”,

                        “text”: “Vivek”

                    }, {

                        “type”: “text”,

                        “text”: “1245 KM”

                    }

                ]

            }

        ]

    }

}

 

For Header type “document” or “video”, change the header parameter “type”: “document” / “video”

Example:

{

  “type”: “header”,

  “parameters”: [{

    “type”: “document”,

    “document”: {

       “link”: “https://link-to-your-document.pdf”

  }

 }

]}

FAQs

What is the format of Whatsapp Number to be used?

The phone number must be in the format: 919898989898
Where, 91 is the country code, followed by the 10-digit (depending on the country) phone number

How can I receive confirmation if a message is delivered or read?

Message sent information is returned to the API request automatically. To receive responses for delivered, read, or any other responses received from Whatsapp, you are required to set up the Callback URL in API Settings.

Setting Callback URL to Receive Tracking Reports and Customer Replies

Webhook/Callback URL is set to receive customer replies, delivery/read receipt, and more information related to messaging. To setup your callback URL, go to Cunnekt API Settings

Callbacks you will receive:

Message Reply
{“contacts”: [{“profile”: {“name”: “Mushik”}, “wa_id”: “919999999999”}], “messages”: [{“from”: “919898989898”, “id”: “ABEGkZVasdasdSADASDOzXq0y7N”, “text”: {“body”: “I am searching API”}, “timestamp”: “1679456958”, “type”: “text”}]}
Delivery Receipt
{“statuses”: [{“conversation”: {“id”: “06d73c2ASD34sfds5d063838e1542”, “origin”: {“type”: “user_initiated”}}, “id”: “gBEGkYJkUmAEASfdasdfFS3XMpQyMg”, “message”: {“recipient_id”: “919999999999”}, “pricing”: {“billable”: true, “category”: “user_initiated”, “pricing_model”: “CBP”}, “status”: “delivered”, “timestamp”: “1678792063”, “type”: “message”}]}
Read Receipt
{“statuses”: [{“id”: “gBEGkASDfsdz2jOXMpQyMg”, “message”: {“recipient_id”: “919999999999”}, “status”: “read”, “timestamp”: “1678792142”, “type”: “message”}]}
24-Hour Window Expiry Time
{“statuses”: [{“conversation”: {“expiration_timestamp”: 1678878480, “id”: “06d73c27a1a5c9sdDSDS838e1542”, “origin”: {“type”: “user_initiated”}}, “id”: “gBEGkYJkUmAESDsdTkKfN4pw”, “message”: {“recipient_id”: “919999999999”}, “pricing”: {“billable”: true, “category”: “user_initiated”, “pricing_model”: “CBP”}, “status”: “sent”, “timestamp”: “1678792564”, “type”: “message”}]}

Send Reply message API

This API endpoint can only be used to send a reply message after a customer has responded within 24 hour customer service window.

If your customer has not responded to you or you want to initiate a conversation with your customer, you should use Template Send API endpoint.

POST: https://app2.cunnekt.com/v1/sendreplymessage

Parameters:

Body

recipient_type

string

individual

to

string

Recipient wa_id

type

string

text, audio, document, image, video

text

string

Contains body field

language

string

Template language

policy

string

Delivery Policy

code

string

Language code

name

string

Template name

Examples  – Sending Text/Media as Reply Message

# For Text

{

    “mobile”: “{91mobile}”,

    “type”: “text”,

    “text”: “hello”

}

 

# For image

{

    “mobile”: “{91mobile}”,

    “type”: “image”,

    “image”: “{link}”

    “caption”: “{caption}”,

}

 

# For audio

{

    “mobile”: “{91mobile}”,

    “type”: “audio”,

    “audio”: “{link}”,

    “caption”: “{caption}”,

}

# For document

{

    “mobile”: “{91mobile}”,

    “type”: “document”,

    “document”: “{link}”,

    “caption”: “{caption}”,

}

# For video

{

    “mobile”: “{91mobile}”,

    “type”: “video”,

    “video”: “{link}”,

    “caption”: “{caption}”,

}

# For Interactive Buttons

{

    “mobile”: “{91mobileNumber}”,

    “type”: “button”,

    “header”: {

        “type”: “text”,

        “text”: “Hello User”

    },

    “body”: “hello test body message”,

    “buttons”: [

        {

            “type”: “reply”,

            “reply”: {

                “id”: “1”,

                “title”: “Book Demo”

            }

        },

        {

            “type”: “reply”,

            “reply”: {

                “id”: “2”,

                “title”: “Learn More”

            }

        },

        {

            “type”: “reply”,

            “reply”: {

                “id”: “3”,

                “title”: “Request Callback”

            }

        }

    ]

}

 

# For Interactive List

{

    “mobile”: “{91mobileNumber}”,

    “type”: “list”,

    “header”: {

        “type”: “text”,

        “text”: “Hello User”

    },

    “body”: “hello test body message”,

    “list_title”: “Chooes Your Option”,

    “list”: [

        {

            “id”: “1”,

            “title”: “Accounts”,

            “description”: “Issuesrelatedtowithdrawalanddeposits”

        },

        {

            “id”: “2”,

            “title”: “Tournament”,

            “description”: “Issuesrelatedtotournamentgameplay”

        },

        {

            “id”: “3”,

            “title”: “Game”,

            “description”: “Issuesrelatedtotournamentgameplay”

        },

        {

            “id”: “4”,

            “title”: “Wallet”,

            “description”: “Issuesrelatedtotournamentgameplay”

        },

        {

            “id”: “5”,

            “title”: “Makeup”,

            “description”: “Issuesrelatedtotournamentgameplay”

        },

        {

            “id”: “6”,

            “title”: “Dance”,

            “description”: “Issuesrelatedtotournamentgameplay”

        }

    ]

}

Message encoding:

Formatting

Symbol

Example

Bold

Asterisk (*)

Your total is *$10.50*.

Italics

Underscore (_)

Welcome to _WhatsApp_!

Strike-through

Tilde (~)

This is ~better~ best!

Code

Three backticks (“`)

“`print ‘Hello World’;“`

Whatsapp
Whatsapp

Request An Immediate Call Back

Enter your number to request a callback. Our team will get in touch with you within five minutes.