Connectors / Service / Attentive Mobile

Artisan IMG > Attentive Mobile (attentive-mobile)

Attentive Mobile

Attentive is a comprehensive personalized mobile messaging solution.

Overview

Attentive Mobile allows people the ability to add subscribers to an Attentive solution plan. Using real-time behavioural data, Attentive automatically sends engaging text messages to each subscriber at every step of the customer lifecycle.

Authentication

Within the builder, click on the Attentive Mobile connector to display the connector properties panel. Select the 'Auth' tab and click on the 'New authentication' button.

add-auth

In the Tray.io authentication pop-up modal, name the authentication in a way that will quickly identify it within a potentially large list. For example, whether it is a Sandbox or Production auth, etc.

Consider who/ how many people will need access to this authentication when choosing where to create this authentication ('Personal' or 'Organisational').

As you can see, the next page will ask you to select the type of authentication you wish to create. This is either 'Token' or 'OAuth 2'.

1. OAuth 2.0 Authentication

Oauth 2

Suppose you choose to create an OAuth 2.0 authentication. You will be instructed to provide the Client ID and Client Secret. Creating a public application will allow you to retrieve this information. Please note that if your Attentive Mobile application is public you will need to use this authorization flow.

2. Token-based Authentication

If you choose to create a token-based authentication, you will need to enter your API Key.

attentive-mobile-token-based-auth

To generate a unique API key, you must create an app in the Attentive platform. Please note that if your Attentive Mobile application is private you will need to use this authorisation flow.

Once you have added these fields to your Tray.io authentication popup window, click on the 'Create authentication' button. Go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Example usage

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Attentive Mobile connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

Below is an example of a way in which you could potentially use the Attentive Mobile connector to subscribe a collection of users.

The steps will be as follows:

  1. Setup the workflow using a manual trigger and a Script helper connector in order to stimulate a data response.

  2. Loop through the list provided, and return the details of each individual item.

  3. Setup the Attentive Mobile connector to subscribe each user to your Attentive mobile account.

The final outcome should look like this:

Final workflow

1 - Setup Trigger & Execute Script

Once you have clicked 'Create new workflow' from your main Tray.io dashboard (and named said new workflow), select the Manual trigger from the trigger options available:

attentive-mobile-manual-trigger

After you have been redirected to the Tray.io workflow dashboard, from the connectors panel on the left, add a Script Helper connector to your second step. Set the operation to 'Execute Script'.

The purpose of this step is to make sure there is some 'dummy data' available so that the Attentive Mobile connector can has something to build with.

1
// You can reference the input variables using input.NAME
2
exports.step = function(input) {
3
return [
4
{
5
email: 'testing-1@traydocs.com',
6
visitor_id: 287344
7
},
8
{
9
email: 'testing-2@traydocs.com',
10
visitor_id: 287344
11
}
12
]
13
};

Paste this into the 'Script' input field (note that you don't need to worry about the 'Variables' field in this example, and can in fact delete these fields for now).

Script step

Feel free to re-name your steps as you go along to make things clearer for yourself and other users.

2 - Loop List

Next, search for the 'Loop collection' connector within your connector panel, and drag it into your workflow as your next step. Set your operations to 'Loop list'.

The Loop Collection connector allows you to iterate through a list of results. In this example, we will use it to iterate through the phone data found within the previous connector step.

In order to specify the list you want to loop through, start by using the 'List' mapping icon (found next to the list input field within the properties panel) to generate the connector-snake.

While hovering over the 'Execute script' step (with the tail end of the connector-snake), select result from the list of output properties displayed. This will auto-populate a jsonpath within your 'List' input field, and update the type selector.

For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.

CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

Loop list

This step enables the user to loop through each list item, and return their individual details.

3 - Subscribe user

The last step is to drag a Attentive Mobile connector inside the Loop Collection step itself. Set the operation to 'Subscribe user'. As you can see, one of 'Phone' or 'Email' is required as well as the 'Sign up source ID' field.

Use the connector-snake to find the jsonpath for the 'Email' field we had in our script results from the loop step. It should appear similar to this `$.steps.loop-1.value.email`.

Do the same with the 'Visitor ID' field (this will be our 'Sign up source ID'). Both should now be auto-populated with the jsonpath required for them to retrieve the necessary information.

Loop list

Now when the workflow is run, each new contact along with their contact details, will be added to the Attentive Mobile account. You can view the results of this within your Debug panel:

final-result

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our managing data best practices guide.

All Operations

Latest version:

1.1

Create custom attributes

Create custom attributes.

Create custom events

Create custom events to be used in the Attentive Segment and Journey Builders.

Raw HTTP request (advanced)

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.

Subscribe user

Opt-in a user to a subscription.

Unsubscribe user

Unsubscribe a user from a subscription type or channel.