Access your customers' Salesforce records

Setup Guide

You can find your Salesforce application credentials by visiting your Salesforce developer dashboard.

You'll need the following information to set up your Salesforce App with KollaConnect:

  • Consumer ID

  • Consumer Secret

Configure your Salesforce app

  1. Go to your Salesforce setup page and type "App Manager" in the search box, and select "App Manager" from the results.

  2. If you don't have an app already, create a new app by clicking on "New Connected App"

3. Add your app name and other information as required

4. Check the box next to "Enable OAuth Settings. In the redirect URLs section, add the KollaConnect OAuth2 redirect URL:

5. Then add the OAuth scopes your integration will need.

The following scopes are required to work with KollaConnect:

  • Perform requests at any time (refresh_token, offline access)

  • Manage user data via APIs (api)

6. Hit save, noting the the Consumer ID and Consumer Secret for use later.

Add your Salesforce app to Kolla

1. In the Kolla admin portal, go to Integrations > Connectors and click Add Connector.

2. Choose Salesforce from the catalog of connectors

3. Name your instance of this connector and input the following configuration items:

  • Consumer ID (from Salesforce app setup in previous steps)

  • Client Secret ((from Salesforce app setup in previous steps)

Press the save button to finish adding this connector.

Connecting to Salesforce

Once your users have connected their Salesforce account, you can use the Kolla SDK to access your users' Salesforce access token and use that to connect to Salesforce.

See the Salesforce API documentation for their full API reference.

// Use KollaConnect client to get your user's salesforce access token

// Get the consumer's auth token to salesforce
var clientSalesforceToken = kolla.getToken("salesforce", customerId)

var jsforce = require('jsforce');
var conn = new jsforce.Connection({
  accessToken: clientSalesforceToken

var records = [];
conn.query("SELECT Id, Name FROM Account", function(err, result) {
  if (err) { return console.error(err); }
  console.log("total : " + result.totalSize);
  console.log("fetched : " + result.records.length);
  console.log("done ? : " + result.done);
  if (!result.done) {
    // you can use the locator to fetch next records set.
    // Connection#queryMore()
    console.log("next records URL : " + result.nextRecordsUrl);

Last updated