Sending Text Messages

Use this API to send text messages.

To send a text message, make a POST call to /messages and attach a message object with type=contacts .

Parameters

This is the main parameter used in sending text message requests:

NameDescription

to

Required

WhatsApp ID or phone number for the person you want to send a message to.

The phone numbers in these requests can be provided in any dialable format, as long as they include their country code. It's recommended that you explicitly prefix the country code with a plus sign (+).

Here are some examples of supported phone number formats:

  • +1-000-000-0000
  • +1 (000) 000-0000
  • +1 000 000 0000
  • +1 (000) 000 0000

reply_message_id

Optional
You can send any message as a reply to a previous message in a conversation by including the previous message's ID. The recipient will receive the new message along with a contextual bubble that displays the previous message's content.

type

Required
The type of message you want to send. Set this as individual

text

.

text

Required
A text object.

text.body

Required

The text of the text message, which can contain URLs (beginning with http:// or https://) and formatting.

If you include URLs in your text and want to include a preview box in text messages (preview_url: true), make sure the URL starts with http:// or https:// (HTTPS URLs are preferred). You must include a hostname, since IP addresses will not be matched.

Maximum length: 4096 characters.

text.preview_url

Optional

By default, WhatsApp recognizes URLs and makes them clickable, but you can also include a preview box with more information about the link. Set this field to "true" if you want to include a URL preview box.

Most of the time, the receiver will see a clickable URL when you send a URL, set "preview_url" to "true", and provide a body object with an HTTP or HTTPS link.

URL previews are only rendered after one of the following has happened:

  • The business has sent a message template to the user.
  • The user initiates a conversation with a "click to chat" link.
  • The user adds the business phone number to their address book and initiates a conversation.

Default:

false

.

Example

Sample request:

curl -X POST 'https://waofficial-rm.botika.online/api/whatsapp/v1/messages' \
-H 'Authorization: Bearer {{ API_TOKEN }}' \
-H 'Content-Type: application/json' \
-d '{
    "to": "+62821xxxxxx",
    "reply_message_id": "{{ MESSAGE_ID }}",
    "type": "text",
    "text": {
        "body": "MESSAGE_CONTENT",
        "preview_url": false
    }
}'

A successful response includes an object with an identifier for the message:

{
    "data": {
        "status": "{{ MESSAGE_STATUS }}"
        "message": "Message Sent!"
        "request_id": "{{ unique request_id from route mobile }}"
    }
}

Copyright © 2025 Botika Teknologi Indonesia