Introduction:
In this article , we will demonstrate how to use Twilio API for sending SMS using Mulesoft.
Architecture Diagram:
Prerequisite:
1, Need to have an active account in Twilio.For new Account, signup here.
2. In Anypoint studio, add Twilio connector module from exchange.
Implementation:
- Preparing payload for sending SMS through Twilio API
Here, we need to pass Twilio Account Mobile number to “From” key and pass recipient mobile number to “To” key. The content of the message can be passed to “Body” key.
- Configuring Twilio Create Message connector
Here, In Username, we need to give Account Sid value which will be in Twilio Account, and in Password we need to give authentication token of Twilio Account.
- Checking the status of message sent
Once we have sent the payload to Twilio, it will return the status of message Sample response from the Twilio:
Conclusion:
Message was successfully sent to Recipients using the Twilio API.
Reference Link:
For additional information, please check below: