Search

Send Whatsapp Message

Articles

Use this function to send a WhatsApp message to the Twilio verified WhatsApp number.

Syntax

Send Whatsapp Message (token, account_sid, from_number, to_number, message_body)

Parameters

Input Parameter Name Description
token Used for authentication
account_sid Used for authentication
from_number Twilio registered number the message needs to be sent from
to_number Twilio registered number the message needs to be sent to
message_body Message to be sent

To know more about token and account_sid, click here.

Returns

Return Value Description
Output
  • On Success returns 1 | Message ID
  • On Failure returns 0 | Error Message

Sample

Send Whatsapp Message (ABCDCEF, QWERTY, +911234567890, +910987654321, Hello, All!)

  • Uses token ABCDCEF and account_sid QWERTY to authenticate connection to Twilio, sends a WhatsApp message Hello, All! from the number +911234567890 to the number +910987654321.
    Returns the Message ID of the sent WhatsApp message.

To view all the Twilio functions, click here.

Did you find what you were looking for?