Salesforce Integration Guide

This guide will cover how to integrate your Cue workspace with Salesforce.

Overview

  1. Requirements for Integration
  2. Create a Salesforce Connected App
  3. Create a Cue Flow to connect to Salesforce
  4. Create a lead in Salesforce
  5. Create a case in Salesforce
  6. Create a task in Salesforce

Requirements for Integration

You'll need the following in order to set up this integration:

  1. a Salesforce org that is Enterprise, Unlimited, Performance, or Developer Edition.
  2. System Administrator access to set up the Connected App in Salesforce.
  3. Access to Flows in your Cue workspace (e.g. the Admin role)

Create a Salesforce Connected App

In order to connect to your Salesforce organisation you need to create a Salesforce Connected App to represent the app that will be connecting to your Salesforce org. In this case it will be the Cue platform, so you could call your app "Cue" for example.

See the official Salesforce guide on how to create a Connected App

Make sure that when you create your app that you set OAuth as enabled and give it required scopes like api or full.

Create a Cue Flow to connect to Salesforce

Once you've created your Salesforce connected app, you now need to set up a flow in Cue that will connect to Salesforce.

Salesforce Instance URL

When you make requests to the Salesforce API, the base URL of the full request will be your your Salesforce instance URL, for example:
https://yourInstance.salesforce.com

Getting a Salesforce access token

Any API request you make to a Salesforce API endpoint (e.g. to create a contact) will require an access token. In order to get this access token you will need to make a request to their token API.

The URL for this request is:
https://yourInstance.my.salesforce.com/services/oauth2/token

See the official Salesforce guide on how to generate OAuth 2.0 client credentials.

In your Cue flow, you can do this by creating an HTTP Request step that looks something like the example below. Be sure to insert your client_id and client_secret given to you when creating your Connected App.

If your request is successful you can extract the access token from the response to your request

You can now use this token in your API requests to create a lead, create a case and create a task.

Authenticate your requests

For each HTTP request you make to Salesforce you will have to include the token property you created above. To add this token to your HTTP requests you can do the following:

  1. Expand the Authorization section of the HTTP request settings panel
  2. Set the type to Bearer Token
  3. Click in the Token field and press { to bring up a list of available properties
  4. Type to search and select the token property you created.

Create a lead in Salesforce

To create a lead in Salesforce you can make a POST request to:

https://yourInstance.my.salesforce.com/services/data/v58.0/sobjects/Lead/

Remember to check:
1. the Connected App you created has permission to create Leads
2. you've added authentication to this request
3. you are making the request to your Salesforce instance URL

See an example of this request below:

Create a Case in Salesforce

Cases are typically used to track customer support requests, issues, or service-related tasks. To create a case in Salesforce you can make a POST request to:

https://yourInstance.my.salesforce.com/services/data/v58.0/sobjects/Case/

Remember to check:
1. the Connected App you created has permission to create Leads
2. you've added authentication to this request
3. you are making the request to your Salesforce instance URL

See an example of this request below:


Create a Task in Salesforce

Tasks in Salesforce are used to track activities, appointments, to-do items, or follow-up actions. To create a task in Salesforce you can make a POST request to:

https://yourInstance.my.salesforce.com/services/data/v58.0/sobjects/Task/

Remember to check:
1. the Connected App you created has permission to create Leads
2. you've added authentication to this request
3. you are making the request to your Salesforce instance URL

See an example of this request below: