25 Sep’17

Dynamics 365, EnterpriseIntegrating Twilio Web Service with D365 CRM Online to send SMS Messages


SMS Messages can be sent from a D365 CRM Online to an individual using the Twilio Web Services. In this blog, we will see how can we send SMS Messages from CRM using Twilio Web Service


We will create a message record from CRM which on save will call the Twilio web service via a plugin and send the message to the destination based on the information passed to Twilio from the D365 CRM.


Step 1: Creating Entities

Create the following 2 Entities which are ‘SMS Configuration’ and ‘SMS Message’. The SMS Config entity will only consist of three fields which are

  • Username which will have the value of ‘Account Sid’.
  • Password which will have the value of ‘Authentication Key’.
  • From which will have the value of Twilio ‘Account Phone number’.

The SMS Message entity will consist of the following two fields which are as follows

  • To which will have the value of the ‘Receiver’s Phone number’.
  • Message Body which will have the value of the ‘Message text’ that the receiver will receive.

 **Note: The purpose is to provide dynamic data and to not hardcode any value.

Step 2: Creating Plugin Code to Call the Twilio Web Service

The plugin code will be consisting of two main code blocks:

  1. Web Service Code Block
  2. Main Execute Code Block

Web Service Code Block
We will be using the Web Service code in our plugin code while calling the Twilio Web Service from CRM. For more information on how to call Web Service using plugin refer the following link : http://www.cloudfronts.com/call-web-service-plugin-dynamics-crm/

In this case we need to make modifications to the Web Call Service function block of the Web Service plugin code.

  • Changes made to the ‘Try Block’ of the Web Service Call.

  • We won’t require to make any changes to the WebClientEx code block of the Web Service Call Code.

Main Execute Code Block

  • In the Main Execute Code Block we will be calling the above Web Service Code Block.
  • Retrieving of the SMS Configuration Record can be done using fetch XML method.


Thus, in this way we can send SMS Messages from D365 CRM Online using Twilio Web Services. Hope you find this helpful.

Written by

Team Member


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more