# Send message by whatsaap through twilio

**URL:** <https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [June 14, 2022, 12:58am UTC](https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604 "2022-06-14T00:58:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafsonrangel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rafsonrangel/32/31139_2.png) [@rafsonrangel](https://forum.wixstudio.com/u/rafsonrangel)\
**Post date:** [June 14, 2022, 12:58am UTC](https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604/1 "2022-06-14T00:58:22Z")

</div>

Hello @shantanukumar847 .  
Could you tell me how I use twilio to send messages via whatsapp here on wix?  
Thank you so much already

---

<div class="post-metadata">

**Author:** ![Certified\_Code](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/certified_code/32/80179_2.png) [@Certified\_Code](https://forum.wixstudio.com/u/Certified_Code)\
**Post date:** [June 14, 2022, 2:01am UTC](https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604/2 "2022-06-14T02:01:21Z")

</div>

Hi @rafsonrangel

You can first view how to send SMS via Twilio SendGrid: [https://www.wix.com/velo/examples?search=sms](https://www.wix.com/velo/examples?search=sms)

Then, on the Twilio API Docs - WhatsApp API - there are endpoint url, message body and the Authentication Key.

You can replace the example values on the Velo examples to the WhatsApp one.

Intermediate c oding knowledge required.

---

<div class="post-metadata">

**Author:** ![rafsonrangel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/rafsonrangel/32/31139_2.png) [@rafsonrangel](https://forum.wixstudio.com/u/rafsonrangel)\
**Post date:** [June 14, 2022, 2:26am UTC](https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604/3 "2022-06-14T02:26:05Z")

</div>

Thanks, I’ll take a look.

---

<div class="post-metadata">

**Author:** ![shafna-zainab-fahim](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shafna-zainab-fahim/32/12509_2.png) [@shafna-zainab-fahim](https://forum.wixstudio.com/u/shafna-zainab-fahim)\
**Post date:** [September 8, 2022, 6:30am UTC](https://forum.wixstudio.com/t/send-message-by-whatsaap-through-twilio/40604/4 "2022-09-08T06:30:56Z")

</div>

Hey @rafsonrangel ,  
you could also try adding the prefix “whatsapp:”, followed by the country code of the number and finally the phone number minus the first digit.

In the below example the “from” number is the twilio WhatsApp sandbox number (which is already in the E.164 _formatting_ ), therefore I had to only add the “whatsapp:” prefix.

```javascript
    let countryCode='+94';
    let phoneNum=toPhoneNumber.slice(1);
    twilioClient.messages.create({
        "body": "Hello from WhatsApp", 
        "from": `whatsapp:${twilioPhoneNumber}`,       
        "to": `whatsapp:${countryCode}${phoneNum}` 
    })

```

I hope this helps.
