How to send custom notifications using twilio whatsapp without registering receiver's number?

370 Views Asked by At

I have followed the following steps from https://www.twilio.com/docs/sms/whatsapp/quickstart/node which works great with my the number I have registered with custom messages. Now I changed the number with another WhatsApp number I had but it's not sending messages to that. How do I send without registering? Please note that I have a trial account.

// This works
const whatsappMessage = await textTransport.messages
      .create({
        from: 'whatsapp:+14155238886',
        body: 'Hello there!',
        to: 'whatsapp:+91888888888' // registered number to twilin
      });
// This doesnt work
const whatsappMessage = await textTransport.messages
      .create({
        from: 'whatsapp:+14155238886',
        body: 'Hello there!',
        to: 'whatsapp:+91999999999'  // not registered
      });
2

There are 2 best solutions below

0
On BEST ANSWER

Twilio developer evangelist here.

The Twilio API for WhatsApp allows you to test using our sandbox. However, to send messages to your users without the sandbox restrictions you need to request your own WhatsApp enabled number.

3
On

To receive message to new number must send join [KEY-WORD] from the new number to the WhatsApp number, as you do with the first number