Salesforce is a CRM platform. Analyzing customer interaction records and feedback provides insights into customer behavior, sales trends, and market opportunities.

Welcome to the Salesforce documentation for Dashbot! Integrating Dashbot into your Salesforce account is quick and easy.

Set Up Salesforce API Access

Create a Connected App in Salesforce:

  1. Log into Salesforce and navigate to Setup > Apps > App Manager
  2. Click on New Connected App
  3. Fill in the required details, including the callback URL. Under OAuth settings, select Enable OAuth Settings and add the necessary OAuth scopes for view/read only access
  4. After saving, you'll receive a Consumer KeyandConsumer Secret.

Obtain Access Token:

Send a POST request to Salesforce to obtain an access token.

<https://login.salesforce.com/services/oauth2/token`>
Example:

grant_type: password
client_id: xxxxxxxxxxxxxxx
client_secret: xxxxxxxxxxxxxxx
username: [email protected]
password: yourpasswordyoursecuritytoken

Export Data from Salesforce

Set Up SOQL Query:

Choose the Salesforce object and fields you wish to query. For example, to get data from the Contact object:

SOQL Query:

`SELECT Id, Name, Email FROM Contact`

Send the SOQL Query via Postman:

<https://yourInstance.salesforce.com/services/data/vXX.0/query/?q=YourSOQLQuery>

Headers:

Authorization: Bearer YourAccessToken

Replace yourInstance with your Salesforce instance URL, vXX.0 with your API version, and YourSOQLQuery with the actual SOQL query.

Example:

URL: <https://yourInstance.salesforce.com/services/data/vXX.0/query/?q=SELECT> Id, Name, Email FROM Contact
Headers:
  Authorization: Bearer YourAccessToken

POST responses to Dashbot

When you receive your data, post the data to the following endpoint:

https://tracker.dashbot.io/track?platform=universal&v=10.1.1-rest&type=incoming&apiKey=API_KEY_HERE

Make sure to set the ‘Content-Type’ header to ‘application/json’ and to replace API_KEY_HERE with your api key.

You must send the data with the following fields:

  • text – string – (required)
  • userId – string – (required) – should be the SAME userId for both incoming and outgoing messages this is NOT the bot’s user ID

To review all optional fields see our API reference.

The data to POST should pass the following data:

{
  "text": "Hi, bot",
  "userId": "+14155551234",
  "platformJson": {
    "whateverJson": "any JSON specific to your platform can be stored here"
  }
}

Sample cURL

curl -X POST -H "Content-Type: application/json"
     -d '{"text":"Hi, bot","userId":"+14155551234","platformJson":{"whateverJson":"any JSON specific to your platform can be stored here"}}'
     'https://tracker.dashbot.io/track?platform=sms&v=11.1.0-rest&type=incoming&apiKey=API_KEY'

Notice, you must replace the placeholder API_KEY_HERE above with your api key.