How to integrate with the Salesforce API

Instructions for Salesforce API

ReFocus AI has a robust integration with native Salesforce and 3rd party applications built on Salesforce.

Step 1

To provide access to your Salesforce environment, start by provisioning API access (link to instructions). For the connected application name, provide something descriptive. This can be your organization's name, followed by additional details.


Example: [*Org name*]_ReFocusAI_API

Step 2

The next step is to create an API-only user and provide that user access to the API you just created (link to instructions). Please use support@refocusai.com for the user's email.


Once the user is created, you will need to send the security token manually.

  1. You can use the 'Login As' button to log into the API-only user you created for ReFocus AI.
  2. Go to My Settings from the User icon. 
  3. Reset the Security Token, which will email support@refocusai.com with the security token.
  4. Log off.

This will send the token to the user's email address and is the final step of provisioning API access.

Step 3

Once you have completed these steps, forward your onboarding specialist the following:

  • API URL (connection string) 
  • Consumer Key
  • Consumer Secret
  • Callback URL

Step 4

Now that data can be accessed through the API. There needs to be a place to put your insights back into Salesforce. This requires creating a custom object and specific fields.


To create custom objects, please look at this step-by-guide and follow the steps (link to instructions).

  1. Please call the custom object:  Policy_Cancellation_Prediction_c

Once the object is created, please go to the guide's 'Steps to Create Salesforce Custom Fields' and create the following four fields. After the field name, you'll see the required data type to select:

  1. Policy_c: Text
  2. Predicted_Cancel_c: Checkbox
  3. Confidence_c: Number
  4. Prediction_Date_c: Datetime

Once the object and fields are created, please confirm that the API user you created can access these items.


Tip: Salesforce only allows single underscores. You will get an error message if the field name contains two consecutive underscores.

💡If you have any questions during this process, open a support ticket.