Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
add-return-hook.png
creating-first-workflow.png
final-integration.png
postman-execution.png
readme.md
return-hook-map.png
send-sms-using-twilio.json
send-sms-using-twilio.zip
sms-screenshot.jpg
trigger.png
twilio-action-configure.png
twilio-auth.png
twilio-canvas.png
twilio-final-complete.png
twilio-map.png
twilio-search.png
webhook-canvas.png
webhook-payload.png
webhook.png

readme.md

Send SMS Using Twilio

This example shows how easy it is, to Send SMS from Twilio using webMethods.io. This functionality can be used for sending alerts, status, marketing offers etc via SMS.

Prerequisite

Twilio account with at least one phone number to receive and send SMS. Account SID and Auth Token from Twilio Account Dashboard.

Setup

  1. Go ahead and get started creating a blank workflow. If you need a refresher on how to get to this point, this guide can be a great introduction. Your starting point should resemble this

  2. The Webhook is created by modifying the start icon, which is is the entrypoint to the new flow. Please select the gear on top of the start icon to access settings. Once settings is selected in the start icon, a 'trigger' dialog will appear that allows Webhook to be selected.trigger

  3. Leave Webhook Authentication unchecked. Check/Enable Webhook Payload, add the structure of the input payload into the "Body" text area and click next. Note the webhook url and save this for later. As a best practice, Authentication should be added immedately after flow ("SendSMSUsingTwilio") is working webhook

webhookpayload

  1. Select done once presented with the final dialog. You should now see the start arrow dialog replaced with a webhook icon. webhookconfigured

  2. Now the flow is ready to process, once the webhook receives the request. In the search dialog lookup "Twilio" service and select "Twilio" service. TwilioSearch

  3. Drag and drop it into the flow canvas. TwilioService Connect the arrows from webhook to the twilio icon and then to the end icon. This inserts the 'Twilio' step in the flow.

  4. Configure the "Twilio" step by clicking the gear icon in the step. Select action as "Send and SMS". Give it a name (ie the step name) as "Send an SMS". Click + icon next to "Connect to Twilio" drop down and configure the account credentials to connect to Twilio instance. TwilioAction. Note - if you had already configured the Twilio credentials, just reuse it by selecting from "Connect to Twilio" drop down.

  5. Configure the Twilio credentials. You will use Twilio Account SID and AUTH Token to connect to Twilio in this screen.

TwilioAuth

Click Add to close the window and go back to configure "Twilio "Send an SMS" window. Click "Next"

  1. In the Mapping screen, add the to, from, body from webhook json input. TwilioMap Click Next and complete the form. The resulting flow will look like as below. TwiliofinalThe flow is now ready for testng in the webMethods.io UI

  2. To make this a flow a useful Rest API, you need to return a response. This can be performed by adding a "Return Data on Sync Webhook" service step. In order to do this, in the search dialog lookup "Return" service and select "Return Data on Sync Webhook" service, drag and drop into the flow canvas. The resulting flow will look like as below returnresponselinked

11.Configure the "Return Data on Sync Webhook" service by clicking on the gear icon on the service step, give it a name and click next

  1. In this page map the response status code from Twilio function to Response data of the "Return Data on Sync Webhook" service. returnwebhookmapped. Click Next and Done.

  2. The flow is now ready to test as a Rest API from an external tool like Postman. Please make sure to grab the exposed Rest URL from the Webhook URL field in the first flow step(webhook) and use it as the Rest API URL. restcall. On Succesful execution a SMS will be delivered to the number provided in To field. sms

Complete Solution

Zip file and json file of complete solution can be downloaded from below links.

You can’t perform that action at this time.