dftly Base API


1    Take a dftly Test Drive


1.1 Install the dftly Sample APK on an Android handset

1.2 Testing dftly on the default dftly org in Salesforce.


2    Installation Overview

2.1 Install dftly into your org

2.2 Authorize dftly

2.3 Configure Remote Access Settings

2.4 Create an Agent Profile in your org

2.5 Add the dftly chat component to your agents’ sidebar

2.6 Customize the Support Profile Permission settings

2.6.1 Enable Visualforce Page

2.7 Set up dftly Custom Tabs

2.8 Setting up dftly specific data in Salesforce

2.8.1 Set up your App Key.

2.8.2 Set up FAQs.

2.8.3 Configuring the SampleApp on your handset to access
your Salesforce Org

3    How dftly works with Salesforce.

3.1 Chat requests

3.2 FAQs

3.3 Cases

4    Initialize dftly SDK within your App




dftly is a mechanism that gives
you the ability to engage better with your mobile consumers, i.e. people who
use your mobile apps to do stuff that’s important to them. Specifically, it
brings the following functions to your consumers:

  • Live Chat, where consumers can chat live with your agents, when your agents are logged into Salesforce
  • Cases, where consumers can submit a Case to your Salesforce org, for you to solve in your own time
  • FAQs, where consumers can search through and get details from frequently-asked questions and answers that you can set up in your Salesforce
  • Notifications, where you can push specific messages to your consumers, to be shown and used in your mobile app
  • Transactions, where consumers can check / add their individual information to/from Salesforce. This data can include Standard or Custom objects in Salesforce.

To help you along in making this work for your organization, we
provide the following things:

  1. A Managed Package that you can install into your Salesforce org
  2. A sample app that you can use to test out how things work and give you ideas of how you can make it work for your mobile consumers
  3. A set of APIs that gives your mobile app programmer the ability to make all this magic happen in your mobile app.

This document contains details of configuration in Salesforce
and client-side work with the dftly sample app. There’s also a link at the end
to an Engineering-oriented document that’ll help you use dftly with your own
app (instead of the Sample App we give you).


Our Sample App is just that – a
sample. It works well but looks like shit (there, we said it), so we DO NOT
suggest that you give it to your consumers! It does only a few of the things that are possible with dftly. If you’d like to open up the code,
though, make changes and then deliver, let us know and we’ll send over the

1.0 Take a dftly Test Drive

To test out the dftly sample app with the default salesforce.com org that we’ve set up, please follow the directions given here.

2.0 Installation Overview

Overall, here are the steps you
need to complete to make dftly work for you.

1.      Install
dftly into your Salesforce org, per the instructions in this document.

You need to be an Administrator or
have the right permissions to install an app.

2.      Authorize
dftly to allow your consumers to access your FAQs and Cases.

3.      Set
up a “dftly app” in your org, using a Salesforce screen that we’ll tell you

4.      Set
up preferences in Salesforce so your agents can access contacts created by each
other. If you don’t do this, consumers who connect with one agent will not be
seen by a second agent, if s/he is passed a second chat request from the same

5.      Download
and test out our Sample App, to see how it all works.

Have your programmer work with our SDK (or work directly with our API)
to make your mobile app work with dftly.

If all this sounds complicated, we have news: it is. This
system uses the Cloud AND Mobile technologies and lives within the strict
parameters of Salesforce security, so there are a few hurdles to cross. But
we’ll help you along and make sure it all works just the way you want it.
You’ll get through these steps in just a few minutes! Let’s get started.

2.1 Install dftly into your org

To begin with, login as the Administrator of your organization

Click on this URL to
install the dftly package:


Salesforce will ask you about who should have access to dftly
in your org, on a screen that looks somewhat like the image below. If you want
only some users to be agents who can chat with consumers, make those
selections; else, select “Install for All users”. Don’t worry – you can come
back and make changes later, as needed.



2.2 Authorize dftly

When consumers want to, say, search through your FAQs, they need
to use a secure mechanism to access the FAQs, via dftly. To support that, you
need to let Salesforce know, that dftly can be allowed to access your data. You
only need to do this once. Salesforce (and dftly) remembers your authorization
for upto a year (you can always revoke that from within Salesforce). In this
step, you will be authorizing dftly to access your Salesforce data (FAQs,

Important Notes

Please note that dftly by default takes the oAuth details of the user that clicks on dftly in the drop down menu (on the right hand side of your menu as described below).

All data that is created from the handset app, including Contacts, Cases, Chat Details, User Device details will all carry this User-ID as the Created by user.

The other specific data for the transaction such as the Contact name requesting the Chat, the agent who responded to the Chat will all be recorded in the transaction. But the Created by field will always show the name of the user that authorized dftly initially.

So if you want let’s say your Customer Service Manager’s User-ID to be the Created by user for all handset related data, then you should get him/her to authorize dftly within your org.

In general though, we suggest that you authorize dftly from your Salesforce Administrator ID. This is because there are chances that you may delete let’s say the Customer Service Manager’s ID, if that person is no longer in your org.


When dftly is installed for you,
you will see it listed in the
right-hand-top drop-down menu in Salesforce. Click on the drop down menu (on
the right hand side of your screen).


Choose dftly from the drop down.
You will see a pop-up page that tells you about dftly wanting to access your
Salesforce org. Click on Allow.

You will get an email from
Salesforce asking you to Authorize dftly again, at the end of one year.



dftly is now integrated with your
Salesforce org.


2.3 Configure Remote Access Settings

Now that you’ve told Salesforce to allow dftly to access it on
your behalf, you now need to tell it WHERE dftly will access it from. In the
interest of complete security, Salesforce will only allow access from specified
locations on the Web. To tell it where dftly will come from, do the following
(you can find more details about this in the Salesforce documentation

From Setup, click Security
 | Remote Site Settings.

     Click New Remote Site, enter a descriptive
term for the Remote Site Name and add the URL
https://impelops.com for the remote site (optionally, enter a description for
the site).


Click Save.

Your consumers will now be able to
access your Support agents in Salesforce through dftly.

Almost there – just a couple
more things and you’re done!

2.4 Create an Agent Profile in your org

For creating the Support Agent Profile(Support) for your Org. Click Here for more details.

Navigate to Manage User -> profile. Select the profile that you need to clone. We suggest that you use the Marketing User profile.

Example: Here we are Cloning the Marketing User profile and callng the new profile as Support.

Then click on Save.

2.5 Add the dftly chat component to your agents’

Click on the Setup button on the top menu

Navigate to Build > Customize > Home > Home Page Layouts on the
left sidebar.

adding dftly to agents.png

Click on Page Layout Assignment button

Click on Edit Assignment button; select DE Default for the user-group
(Support Profile) that must receive the dftly chat box.

home page layout assignment.png



Do the following to enable the Chat pop-up in all tabs.

Click on Setup > Customize > User Interface.

Select “Show Custom Sidebar Components on All Pages”.

and Save.


The dftly custom sidebar is now
activated for all your Support Profile users.

To view the custom sidebar, login
as any of the Support Profile users. Click on the Home/Any tab in
your navigation. You will now see the Impel Chat box enabled in the sidebar, as
shown in the screen below.


Customize the Support Profile Permission settings

Login with an ID with System Administration permissions.

Navigate to Setup > Administer > Manage Users> Users


For the Users that need to access dftly, Click on Edit and make sure
that the Profile is set to Custom: Support Profile

user profile setup.png



Now you need to give the selected agents access to the specific
Salesforce objects that they would need to use dftly.

Navigate to Administer > Manage Users > Profiles and click Edit on
the Custom: Support Profile

user profile access.png

Select Cases, Contacts and Other dftly Custom objects, in the Custom
Objects Permissions section as shown in the figure below.

2.6.1 Enable Visualforce Page

Set up a Visualforce page permission for the Support Profile.

Navigate to Administer > Manage Users > Profiles and click on the Support Profile

Click on the Enabled Visualforce Page Access link as shown below.

Click on Edit

Select dftly.Contact_list_apex and dftly.Chat_request_apex Visualforce pages from the list on the left hand side and Add them to the Enabled Visualforce Pages on the right.

Click Save.

Now both the Visualforce Pages can be accessed by the Support Profile group.

2.7 Set up dftly Custom Tabs

Select “+” (ALL Tabs) -> Customize Tab

ADD dftly App, dftly App Contacts, dftly FAQ’s, dftly FAQ’s Categories, User Devices and Save.

2.8 Setting up dftly
specific data in Salesforce

There are a few things that you need to do to set up specific
data that dftly needs.

2.8.1 Set up your App Key.

You need an App Key to use the dftly SDK  in your org. The App
helps dftly to uniquely identify your Org’s App. You could
potentially have multiple apps within the same org (for example a travel site
may have separate apps for airline tickets and hotel bookings). See below for details on how to set up these keys.



App Key is a token that is unique to each of your apps.

– your unique App Key.



     Click on the dftly Apps  tab in your menu bar.

Select New button, Enter any meaningful App Name and click on Save.



If you go back to the list of Apps, you will now see your app listed as shown above, with the App Key showing. Copy those values out, to include in your app. In the next section, we have described how you would use the App Key with the SampleApp that you can use to test out dftly functionality.

2.8.2 Set up FAQs.

Add FAQ Categories, FAQs from the Available Tabs list to the Selected
Tabs list and click on Save.

You will now be able to view the FAQ and FAQ Categories as Tabs.

First create the FAQ Categories that you want for your app by clicking
on the FAQ Categories tab. Examples of FAQ Categories could be Billing,
Shipping and Delivery, Pricing and so on.

Once FAQ Categories are set up, you can set up specific FAQs by clicking
on the FAQs tab. You can tag each FAQ to belong to a specific FAQ Category.


2.8.3 Configuring the SampleApp on your handset
to access your Salesforce Org

By default the Sample App is configured to work with a default org that we have set up in Salesforce.If you want to configure the dftly SampleApp to your specific
salesforce.com org, please follow the instructions given below.


To view the App Key value that you previously generated (see
Section 2.8.1 above), click on the Apps tab in your salesforce.com ID. You
should see the name of the app that you created with the App Key that was
generated for you listed beside the App Name.


On your handset, click on the dftly SampleApp icon. On the main
screen, click on the “+” button on the right hand side top corner of the
actionbar. This will redirect you to another activity, where you need to add
your org’s App key generated in section 2.8.1 above. Key in the App Key value
generated in the APP key textbox on your handset.


IMPORTANT: Please be careful to type in the App Key value exactly as you
see it on your salesforce screen, including all the numbers, digits and
hyphens. It’s a bit painful, but you’ve got to do it.

Once you’ve registered your App Key, the SampleApp on your handset,
connects to your own Salesforce org. The idea here is to simulate the working
of the Sampleapp within your salesforce.com org.

The following screenshots show you how to register your App Key and
register yourself to your own org.




3.0 How dftly works with Salesforce.

Login with the Agent credentials into your salesforce org.

Get into the SampleApp on your handset.

3.1 Chat requests

When the Consumer on the handset requests a chat by clicking on the Live
Chat link on the SampleApp, the Agent logged into salesforce gets a Chat
request as shown below. If the Agent is on the Home tab, s/he automatically
sees the Chat request. If s/he is on a different tab or window, s/he gets a
notification saying that dftly has an incoming Chat request. S/he can then
switch to the main salesforce tab to accept the Chat request.


When the agent accepts the Chat Request. s/he sees the following
screen. On the left, you have the details of the customer who has requested the
Chat and on the right is a Chat window where the details of the Chat between
the customer and the agent are shown.

The sub tabs below the user’s main details, show a list of the
Cases raised by the specific contact, details about the contact’s handset a
list of the previous Chats that the contact has had with your organization.

The Agent can raise a new case during the Chat, by clicking on
the New Case button in the Cases sub-tab.

When the agent has completed the Chat with the consumer s/he
clicks on the End Chat button to complete the Chat.

Each agent can handle up to 3 chats simultaneously.





3.2 FAQs

The SampleApp has a link called FAQs. When the consumer clicks on the FAQs link, s/he
sees a list of all the FAQ Categories on his/her handset. Clicking on any of the Categories, shows all the questions and answers in that category.


The consumer can key in specific keywords or questions in the Search field. All FAQs that match the Search criteria get



3.3 Cases

A consumer can raise Cases with your Support agents by clicking
on the Cases link on the handset. Any Case raised from the handset, gets
recorded as a Case in salesforce. Once the Case is recorded in salesforce, the
consumer gets a notification back with the Case ID of their Case for further
interactions with your support team.



When the consumer clicks on the button called Cases on the handset, s/he
sees a list of all the Cases that s/he has previously raised along with the
Case IDs.

To add a new Case, click on the + on the top right hand side of the
screen. Enter the details of the issue that you are facing and click on Send.
This issue now gets added as a new Case in Salesforce

You will now get a Case ID as a response from Salesforce.






4.0 Initialize dftly SDK within your App

Check out the dftly
learn how to use the SDK.