Monko
Monko

Reputation: 21

Twilio WhatsApp - Already bought phone number and creating messages

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

Answers (1)

philnash
philnash

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:

  1. Request access to enable your Twilio numbers for WhatsApp
  2. Submit a WhatsApp Sender request in the Twilio console
  3. Approve Twilio to message on your behalf in the Facebook Business Manager console
  4. Submit your Facebook Business Manager account for Business Verification
  5. (Twilio completes your WhatsApp Sender registration)

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

Related Questions