IMIconnect makes it easy and flexible for you to automate customer interactions over Twitter’s Direct Messaging interface. Tweets being publicly visible, edges direct messages to be a reliable and secure mode of communication. We will now see a detailed tutorial on how we can send Twitter DM using IMIconnect.

Prerequisites:

         >> Login to the IMIconnect platform using your registered email ID and password

  • Configure the Twitter App

Setup Tasks:

A. Create a Service
B. Configure the Twitter App
C. Create a Flow
D. Create a Rule to Invoke the Flow

A. Create a Service

Refer to the tutorial to know how to create a service on IMIconnect.

B. Configure the Twitter App

Step 1: Add the Twitter App 

  1. Click on Apps from the top menu of IMIconnect.
  2. Click on the CONFIGURE APPS button on the top right side of the screen. 
  3. Choose TWITTER from the dropdown to proceed to the configuration.

Step 2: Setting up the Twitter App 

  1. Name the Twitter App.
  2. Click on ADD TWITTER ACCOUNT. 

   3. You will then be redirected to your Twitter login page.
   4. Login to your Twitter account.
   5. Authorize the IMIconnect Twitter App to use your Twitter account as a business             account. 

  6. You will be redirected to the IMIconnect App Configuration Page.
  7.  Authorize the App. 

Step 3: Configure the Welcome Screen 

  1. Add a welcome text with attachment (image/video/gif). 
  2. Configure the optional quick replies including the description and metadata. Note: This is optional.

   3. Click here to view a sample of the welcome screen.      
   4. Copy the plugin code to your page. The screen name for the button can be                    configured in your ad as is the style.

You can now use the Twitter account to receive and reply to the customer's Twitter direct messages. 

C. Create a Flow

IMIconnect allows you to rapidly configure communication flows using a drag-and-drop flow builder. Here are the steps to configure the flow:

Step 1- Add a Flow

1.Click on Flows on the left menu under Settings.

2.Click on Add New Flow on the top right corner of the Flows screen.

Step 2 – Name the New Flow

1.Name the flow on the CREATE NEW FLOW screen.

2.Choose the Flow type as Workflow.

3.Choose Create blank flow from the drop-down.

4.Click on CREATE FLOW on the top right corner.

Step 3 – Create the Flow

Below is a snapshot of the complete flow. We will now discuss how each of the nodes are configured:

Step 4 – Configure the Branch Node

The three branches are available as three different node outcomes, with a default outcome if none of the conditions matches.

Step 5 – Configure the Quick Reply Node

Use the http node to make a SEND QUICK REPLY Request.

  1. Replace ‘Showcase’ with your domain name in the below example.
  2. Specify the value of the ‘key’ header as your ‘Service Key’ which is available in Services under ‘General’ section.

Note:
a. Click
here to view the sample JSON code.
b. The media id for the attachment to send is retrieved on making an http call to     Twitter servers.
c. The details for the same are available here under the ‘Upload Attachment’ request.

Step 6: Configure the Receive Node

Step 7: Configure the Send Node

Note: $(twitter.message) variable is used to access the last received Twitter direct message. You can also copy the value of the received message to a flow variable at any point in the Session Data tab of a node UI. Click on the Receive node Session Data.

 Here, ‘dm1’ variable is sued to copy the received message and the value of the ‘dm1’ variable is used further in the flow as shown above.

Step 8: Configure the ‘onsuccess’ event

Drag and release the node event (green dot) of a given node to end the flow at that node. 

  1. Click the MAKE LIVE button on the top right to make the flow live. Click on OK
  2. This saves the flow and makes it live. 
  3. You can also switch between previous versions of your saved flow and make the appropriate one live. Now you can test the use case scenario as an end-user by opening a Twitter chat with the user: for e.g., arshusas789.

D. Create a Rule to Invoke the Flow

Step 1 – Create a Rule

  1. Click on Rules under Settings on the left menu. 
  2. Click on ADD NEW RULE button on the top right corner of the screen. 
  3. Select an appropriate channel. In this case Twitter DM.
  4. Choose an event. In this case on Incoming Message.

 5. Add the desired conditions to the rule. If you do not want to add any conditions,            you can skip this step and navigate to Actions, by clicking on SKIP TO ACTIONS

  6. Select an action such as Send SMS or cross channel message or invoke a flow. In          this case choose Invoke a flow.


    7. Choose the relevant flow created, from the drop down.
    8. Enter a name for the rule and select the duration for the rule to execute.
    

    9. To activate the rule, select Active.
    10. Click SAVE & SUBMIT.

Did this answer your question?