docs

WAABOT-SDK APIs: Whatsapp/Bots

The “Whatsapp/Bots” endpoints in our API allow developers to integrate and interact with WhatsApp for building powerful chatbot experiences. With these endpoints, you can leverage the capabilities of WhatsApp to automate conversations, provide information, and engage with users.

Settings


AUTHORIZATION Bearer Token

PUT Update General Info

/whatsapp/updateGeneral

Example Request

curl --location --request PUT '/whatsapp/updateGeneral' \
--header 'x-refresh;' \
--data '{
    "bot_name": "Bot Name",
    "bot_timezone": "+1",
    "bot_lang": "en",
    "default_msg": true
}'

Example Response


PUT Update Bot Actions

/whatsapp/updateActions

Example Request

curl --location --request PUT '/whatsapp/updateActions' \
--header 'x-refresh;' \
--data '{
    "send_default_msg": true,
    "reply_group_msgs": true,
    "reply_unread_msgs": true,
    "reply_msgs": true,
    "multi_device": true,
    "send_webhook": true
}'

Example Response


PUT Update Active Days

/whatsapp/updateActiveDays

Example Request

curl --location --request PUT '/whatsapp/updateActiveDays' \
--header 'x-refresh;' \
--data '{
    "monday": true,
    "tuesday": true,
    "wednesday": true,
    "thursday": true,
    "friday": true,
    "saturday": true,
    "sunday": true
}'

Example Response


PUT Update Active Hours

/whatsapp/updateActiveHours

Example Request

curl --location --request PUT '/whatsapp/updateActiveHours' \
--header 'x-refresh;' \
--data '{
    "from": "00:00",
    "to": "5:00"
}'

Example Response


PUT Set Webhook

/whatsapp/setWebhook

Example Request

curl --location --request PUT '/whatsapp/setWebhook' \
--header 'x-refresh;' \
--data '{
    "session_id": "",
    "access_token": "",
    "webhook_url": "https://eoy4r2ybzzfdw9y.m.pipedream.net",
    "events": [
        "onMessage",
        "onAnyMessage"
    ],
    "requestConfig": {}
}'

Example Response


Instance Bot


AUTHORIZATION Bearer Token

POST Create(Require Auth)

/whatsapp/createNewWhatsapp

Example Request

curl --location '/whatsapp/createNewWhatsapp' \
--header 'x-refresh;' \
--data '{}'

Example Response


POST Init Instance

/whatsapp/init

Init a new WhatsApp instance

Example Request

curl --location '/whatsapp/init' \
--header 'x-refresh;' \
--data '{
    "session_id": "",
    "access_token": "",
    "config": {
        "multiDevice": true,
        "setWebhook": true,
        "webhookUrl": "valid_url"
    }
}'

Example Response


GET Scan QR

/whatsapp/scan?session_id=&access_token=

Get an instance QrCode

Example Request

curl --location '/whatsapp/scan?session_id=&access_token=' \
--header 'x-refresh;'

Example Response


GET Get QR in Base64

/whatsapp/scan?session_id=&access_token=&format=base64text

Example Request

curl --location '/whatsapp/scan?session_id=&access_token=&format=base64text'

Example Response


GET Get one instance Info(Connected Status and Phone Number)

/whatsapp/instance/?session_id=&access_token=&format=base64

Example Request

curl --location --request GET '/whatsapp/instance?session_id=&access_token=&format=base64' \
--header 'x-refresh;' \
--data '{
    "session_id": "",
    "access_token": ""
}'

Example Response


DEL Delete Instance

/whatsapp/61a7bd6ea34282366c025764

Example Request

curl --location --request DELETE '/whatsapp/61a7bd6ea34282366c025764'

Example Response


GET Logout Instance

/whatsapp/instance/logout/61a7bd6ea34282366c025764?session_id=&access_token=

Logout WhatsApp session from mobile

Example Request

curl --location '/whatsapp/instance/logout/61a7bd6ea34282366c025764?session_id=&access_token='

Example Response


GET Get All Instances

/whatsapp

Example Request

curl --location --request GET '/whatsapp' \
--data '{
    "session_id": "",
    "access_token": ""
}'

Example Response


Message


AUTHORIZATION Bearer Token

POST Send Text Message

/whatsapp/message?session_id=&access_token=

Send a text message to WhatsApp User or Group

Example Request

curl --location '/whatsapp/message?session_id=&access_token=' \
--header 'x-refresh;' \
--data '{
    "session_id": "",
    "access_token": "",
    "chatId": "",
    "message": "Hello dear",
    "attachments": [
        "64ac311eee05a1a2c27fbdb5",
        "64ac265749240c35b96cb78c"
    ],
    "location": {
        "name": "locationName",
        "lat": "6.556452",
        "lng": "3.2774487"
    },
    "contactId": "64a00ec7c5e487d95dcb0d5e"
}'

Example Response


POST Send Image Message

/whatsapp/message/image?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/image?session_id=&access_token=' \
--form 'file=@"/C:/Users/Mrbarnk/Downloads/Nvestos/1_dark - Copy (2).png"' \
--form 'chatId=""' \
--form 'caption="Yo"'

Example Response


POST Send Video Message

/whatsapp/message/video?session_id=&access_token=

Send a video message to WhatsApp User

Example Request

curl --location '/whatsapp/message/video?session_id=&access_token=' \
--form 'file=@"/path/to/file"' \
--form 'chatId=""' \
--form 'caption=""'

Example Response


POST Send Audio Message

/whatsapp/message/audio?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/audio?session_id=&access_token=' \
--form 'file=@"/path/to/file"' \
--form 'chatId=""'

Example Response


POST Send Document Message

/whatsapp/message/doc?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/doc?session_id=&access_token=' \
--form 'file=@"/path/to/file"' \
--form 'chatId=""' \
--form 'filename=""'

Example Response


POST Send File URL

/whatsapp/message/fileurl?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/fileurl?session_id=&access_token=' \
--form 'chatId="2349048988056"' \
--form 'url="https://images.unsplash.com/photo-1597431793715-b4b71ddb5670?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxfDB8MXxyYW5kb218MHx8fHx8fHx8MTY1Nzc2MTY4NA&ixlib=rb-1.2.1&q=80&utm_campaign=api-credit&utm_medium=referral&utm_source=unsplash_source&w=1080"' \
--form 'type="image"' \
--form 'mimetype="image/jpeg"' \
--form 'caption="Caption"'

Example Response


`POST Send Button(Template) Message

/whatsapp/message/button?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/button?session_id=&access_token=' \
--header 'Content-Type: application/json' \
--data '{
    "chatId": "",
    "btndata": {
        "text": "title Head",
        "buttons": [
            {
                "type": "replyButton",
                "title": "Reply this text (REPLY)"
            },
            {
                "type": "urlButton",
                "title": "Click me (URL)",
                "payload": "https://google.com"
            },
            {
                "type": "callButton",
                "title": "Click to call (CALL)",
                "payload": "918788889688"
            }
        ],
        "footerText": "title footer"
    }
}'

Example Response


POST Send Contact Message

/whatsapp/message/contact?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/contact?session_id=&access_token=' \
--data '{
    "chatId": "2348179803743",
    "vcard": {
        "fullName": "john doe",
        "displayName": "johndoe",
        "organization": "Men In Black",
        "phoneNumber": "919999999999"
    }
}'

Example Response


Send List Message

/whatsapp/message/list?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/list?session_id=&access_token=' \
--header 'x-refresh;' \
--data '{
  "chatId": "2349048988056",
  "msgdata": {
    "buttonText": "Button Text",
    "text": "Middle Text",
    "title": "Head Title",
    "description": "Footer Description",
    "sections": [
      {
        "title": "title",
        "rows": [
          {
            "title": "Title Option 1",
            "description": "Option Description",
            "rowId": "string"
          }
        ]
      }
    ],
    "listType": 0
  }
}'

Example Response


POST Send Button With Media

/whatsapp/message/MediaButton?session_id=&access_token=

Example Request

curl --location '/whatsapp/message/MediaButton?session_id=&access_token=' \
--data '{
    "chatId": "2348179803743",
    "btndata": {
        "text": "Title of Message",
        "buttons": [
            {
                "type": "replyButton",
                "title": "this button reply"
            },
            {
                "type": "callButton",
                "title": "this button calls",
                "payload": "91999999999"
            }
        ],
        "footerText": "Footer text",
        "image": "https://picsum.photos/536/354",
        "mediaType": "image",
        "mimeType": "image/jpeg"
    }
}'

Example Response


POST Send Text(Depreciated)

/whatsapp/message/sendText

Example Request

curl --location '/whatsapp/sendText' \
--data '{
    "session_id": "",
    "access_token": "",
    "to": "2348179803743",
    "message": "Hello sir 3."
}'

Example Response



We hope this guide provides you with the necessary information to create WhatsApp bots and send messages using our API. If you have any questions or need further assistance, please feel free to contact our support team.