×

Please give details of the problem

Skip to content

SMS Sending Application with Twilio in RunMyProcess DigitalSuite

This guide outlines how to create and configure an application in RunMyProcess DigitalSuite to send SMS using Twilio. This documentation will guide you through each necessary step to develop a fully functional application that can be customized to suit your organization's needs.

Application Overview

The application allows users to send SMS messages through Twilio using a simple web interface and an automated process in RunMyProcess DigitalSuite. The application includes the setup of an organization, projects, processes, web interfaces, connectors, and report generation to monitor activity.

Step 1: Creating the Organization in RunMyProcess DigitalSuite

To start building your application, you first need to set up an organization in RunMyProcess DigitalSuite. This organization will act as the framework that contains all the necessary components, including projects, processes, interfaces, and connectors.

Detailed Steps:

  1. Access RunMyProcess DigitalSuite: Log in to your RunMyProcess DigitalSuite account.
  2. Navigate to the Organizations section: From the main dashboard, go to the Roles management section.
  3. Create a new organization: Click 'New Organization'. Enter a representative name for the organization, such as "MyApp - SMS". Use a clear and descriptive name that reflects the purpose of the application.
  4. Assign roles: Create and assign the 'Designer' role to yourself or other users. This role is crucial as it provides full access to configure and customize the application, allowing for adjustments in projects, processes, and other key settings. Additionally, create and assign a role called 'Everybody'. This role should be available for all users so they can initiate the flow. It ensures that anyone with access can start the process without needing elevated permissions.
  5. Save the organization: Once you have entered all the necessary details, click 'Save' to finalize the creation of the organization. This organization will serve as the foundation on which you will build your SMS sending application.

Step 2: Creating the Main Project in RunMyProcess DigitalSuite

Once the organization is set up, the next step is to create the main project that will contain all the application components. This project will serve as the foundation on which processes, web interfaces, and connectors will be built.

  1. Access the Projects section: Navigate to the 'Projects' section from the main dashboard of your RunMyProcess DigitalSuite account.
  2. Create a new project: Click on 'Create New Project'. Following best practices, name the project in a way that reflects its purpose within the application, for example, " MyApp - SMS ".
  3. Project configuration: During the project creation process, you will be asked to specify certain parameters, such as the organization to which this project belongs. Make sure to select " MyApp - SMS " as the associated organization. This ensures that all resources created within the project are organized under the correct structure.
  4. Save the project: Once you have entered all the necessary details, click on 'Save' to complete the project creation. This project will now serve as the container for the processes, interfaces, and other resources that will build the application.

Step 3: Creating the Provider and Connector in RunMyProcess DigitalSuite

With the web interface configured, the next step is to establish communication with Twilio by creating a provider and a connector in RunMyProcess DigitalSuite. These elements enable the application to send SMS using the Twilio API.

Detailed Steps:

  1. Access the Connectors section: Within the "MyApp-SMS" project, navigate to the 'Connectors' section.
  2. Create an account in Twilio:
    • Before proceeding, you will need a Twilio account. If you don't have one yet, go to Twilio and sign up for a free account.
    • Once registered, Twilio will provide you with an Account SID and an Auth Token, which you will need for the configuration.
  3. Create the Twilio provider:

    • Click on 'New Provider'.
    • Name the provider "Twilio Provider".
    • In the 'URL' field, enter Twilio's base URL, which is typically https://api.twilio.com/2010-04-01/Accounts/${AccountID}. This URL will be used for all API calls to Twilio.

      • ${AccountID}: This is the variable to define the ID of the Twilio account
  4. Configure authentication:

    • Set up the provider's authentication using the Basic Auth method. Enter the Account SID and Auth Token you obtained when creating your Twilio account.
  5. Apply configuration to all the environments
    • Copy this configuration to the other environments (ACCEPTANCE, TEST).
    • Save the provider configuration.
  6. Create the Twilio connector:
    • Next, go to the provider actions and click on 'Add Connector'.
    • Name the connector " Send SMS " to clearly indicate its function.
  7. Configure the connector:

    • Define the endpoint URL as /Messages.json, which is the specific path for sending SMS messages through Twilio.
    • Select the POST method to send the data.
    • Select the Result Format as JSON.
    • Set the content as To=${recipient_number}&From=${from_number}&Body=${message}

      • ${recipient_number}: This is the variable to define the number that will receive the message (include the country code).
      • ${from_number}: This is the variable to define the number from the message is sent. This value is provided by the Twilio account (include the country code).
      • ${message}: The variable to define the message.
    • Select the Content type as application/x-www-form-urlencoded.

  8. Save the connector: Once the connector is configured, click on 'Save' to save it. This connector will now be ready to be used in the process that sends SMS messages.

  9. Test the connector: Click on 'Launch' and add the value for each variable. Then click on 'Launch test'.

Step 4: Creating the Main Process in RunMyProcess DigitalSuite

Now that we have configured the Twilio connector, the next step is to create the process that will link these elements and manage the workflow of the application. This process will automate the task of taking the information from the web interface and sending it through the connector to dispatch the SMS.

Detailed Steps:

  1. Access the Processes section: Within the "MyApp_SMS" project, navigate to the 'Processes' section.
  2. Create a new process:
    • Click on 'Add'.
    • Name the process "MyApp_SMS_MAIN". Following best practices, the "_MAIN" suffix indicates that this is the main process of the application.
    • Select the role that will initialize the process. In this case "Everybody".
  3. Design the workflow:
    • Next, add a "Connector" activity to the process. This activity will handle sending the data to the connector we previously configured to send the SMS.
  4. Configure the connector activity:
    • Set up the connector activity to use the " Send SMS ".
    • Map the input variables from the web interface, such as "from_number", "recipient_number" and "message", to the parameters expected by the connector. This ensures that the data entered by the user in the interface is correctly sent through the Twilio connector.
  5. Finalize the process:
    • Add an "End Event" to the process diagram and connect it to the connector activity. This event will mark the end of the process once the SMS has been sent.
    • Save the process by clicking on 'Save'.

Step 5: Creating the Web Interface in RunMyProcess DigitalSuite

With the main process created, the next step is to design the web interface that users will use to enter the necessary data to send an SMS. This interface will include fields for the recipient's phone number and the message, as well as a button to submit the information.

Detailed Steps:

  1. Access the Web Interfaces section: From the " MyApp - SMS " project, navigate to the 'Web Interfaces' section.
  2. Create a new web interface: Click on 'Add'. Name the interface "MyApp - SMS Form". Using a descriptive name makes it easier to identify the interface and its purpose within the application.
  3. Design the interface:
    • Add a field for the from number: Drag and drop a number input from the widget menu. Name the associated variable "from_number". This field is the number from the message is sent. This value is provided by the Twilio account.
    • Add a field for the phone number: Drag and drop a number input from the widget menu. Name the associated variable "recipient_number". This field will allow users to enter the recipient's phone number.
    • Add a field for the message: Drag and drop a text area for the text message. Name the associated variable "message". This is where users will write the content of the SMS.
    • Add a submit button: Finally, add a 'Submit' button. This button will trigger the main process, "MyApp – SMS - MAIN" which will send the data through the Twilio connector.
  4. Configure the submit button: Configure the 'Submit' button so that, when pressed, it triggers the "MyApp - SMS - MAIN" process. This ensures that the entered data is correctly sent to the process for handling.
  5. Save the web interface: Once you have configured all elements of the interface, click 'Save' to save the interface. This interface will now be ready for users to send SMS messages.

Step 6: Running the Application and Generating the Report in RunMyProcess DigitalSuite

After setting up all the components of the application (organization, project, connector, process and web interface), the final step is to run the application to ensure everything functions correctly and generate a report to verify the SMS dispatch.

Detailed Steps:

  1. Running the Application:
    • Go to the " MyApp - SMS Form " web interface that you configured earlier in the 'Web Interfaces' section.
    • Enter from number, number and message field.
    • Click the 'Submit' button to initiate the "MyApp_SMS_MAIN" process. This process will take the entered information and send it through the Twilio connector.
  2. Verifying the SMS Dispatch:
    • After clicking 'Submit', the process should send the SMS using Twilio. To verify that everything worked correctly, it is recommended to check the process status.
    • Go to the 'Reports' section and select 'Process Reports'.
    • Look for the "MyApp_SMS_MAIN" process and check that the status is 'Success' or 'Completed'.
  3. Generating the Report:
    • In the 'Reports' section, you can also generate a more detailed report that includes all the data from the process executions.
    • Select the "MyApp_SMS_MAIN" process and generate a report that includes information such as the phone number to which the SMS was sent, the message content, and the final process status.
  4. Reviewing Logs and Troubleshooting (if necessary):
    • If the process does not run as expected or if the SMS is not sent correctly, review the detailed logs in the 'Reports' section to identify possible errors.
    • These logs will help you diagnose issues and make adjustments to the connector, interface, or process configuration to ensure everything works correctly.