25 Sep’17

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

Introduction:

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

Scenario:

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.

Process:

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 : https://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.

Conclusion:

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

CloudFronts

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

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more