Hello @shantanukumar847 .
Could you tell me how I use twilio to send messages via whatsapp here on wix?
Thank you so much already
1 Like
You can first view how to send SMS via Twilio SendGrid: 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.
Thanks, I’ll take a look.
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.
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.