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

Returns

Return Value Description
Output
  • On Success: 1, Message ID
  • On Failure: 0, Error Message

Sample

Send Whatsapp Message (ABCDCEF, NC-45, 1234567890, 0987654321, Hi all just testing)

  • Uses the token ‘ABCDCEF’ and the account_sid ‘NC-45’ to authenticate the connection to the Twilio application, sends a WhatsApp message ‘Hi all just testing’ to the number ‘1234567890’ from the number ‘0987654321’.
    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?