Reputation: 21
To send an SMS we can do:
await twilio.messages.create({
to: "07888888888",
from: twilioMessagingServiceSid,
body: "Body of message",
});
When using Whatsapp is it possible to do the same in the from
parameter as in passing the twilio messaging service sid?
I would like to be able to support both SMS and WhatsApp for our customers using the same phone number that is already in use for SMS messaging.
Upvotes: 0
Views: 971
Reputation: 73029
Twilio developer evangelist here.
You can enable your Twilio number to send WhatsApp messages as well as SMS messages. There are a few steps to go through, at a high level they look like this:
The full instructions to connect your Twilio number to your WhatsApp Business Profile are available in the documentation here.
Once you have done that, you can add your WhatsApp enabled number to the messaging service. Then, when you send a message to a WhatsApp number you can use the messaging service as the from
and a WhatsApp number as the to
.
Upvotes: 0