Search

Send Message

Last Updated: Nov 4, 2020

Articles

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

Syntax

Send 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 to make a call
to_number Twilio registered number to connect a call
message_body Message to be sent

Returns

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

Sample

Send Message (ABCDCEF, NC-45, 1234567890, 0987654321, Hello)

  • Uses the token ‘ABCDCEF’ and the account_sid ‘NC-45’ to authenticate the connection to the Twilio application, sends the message ‘Hello’ to the number ‘1234567890’ from the number ‘0987654321’.
    Returns the ‘Message ID’ of the sent message.

To view all the Twilio functions, click here.

Did you find what you were looking for?