Description
Nowadays, it is common to send automated texts using social media platforms.
Now, let us see how to send WhatsApp messages and SMS messages using Studio Pro.
Prerequisites
The "Twilio Sandbox for WhatsApp" needs to be set up to use this feature.
Instructions
Whatsapp messages
In Studio Pro:
The parameters for the HTTP request to send Whatsapp messages from Studio Pro need to be provided as follows:
URL: https://api.twilio.com/2010-04-01/Accounts/AC9c78dee256a67ff8a7e3193c51eb8dad/Messages.json where AC9c78dee256a67ff8a7e3193c51eb8dad is the Account SID.
Method: POST
Authorization header: Username is Account SID
and password is the AUTH_TOKEN
Additional headers:{"Content-type":"application/x-www-form-urlencoded"}
Body parameters:
1{
2 "Body":"Hello",
3 "To":"whatsapp:+91730511222",
4 "From":"whatsapp:+14155238886"
5}
SMS Messages
In Studio Pro:
The parameters for the HTTP request to send SMS messages from Studio Pro need to be provided as follows:
URL: https://api.twilio.com/2010-04-01/Accounts/AC9c78dee256a67ff8a7e3193c51eb8dad/Messages.json where AC9c78dee256a67ff8a7e3193c51eb8dad is the Account SID.
Method: POST
Authorization header: Username is Account SID
and password is the AUTH_TOKEN
Additional headers:{"Content-type":"application/x-www-form-urlencoded"}
Body parameters:
1{
2 "Body":"Hello",
3 "To":"+91730123456",
4 "From":"+1 985 616 6020"
5}
The "From" number — which in our case is +1 985 616 6020 — needs to be purchased from Twilio. Notice that, on the publishing date of this article, Twilio provides a default amount of $15 dollars for your trial account, from which the "From’" number can be purchased for $1 dollar.