Salesforce Integration Guide

This guide will cover how to integrate your Cue workspace with Salesforce.
Overview
- Requirements for Integration
- Create a Salesforce Connected App
- Create a Cue Flow to connect to Salesforce
- Create a lead in Salesforce
- Create a case in Salesforce
- Create a task in Salesforce
Requirements for Integration
You'll need the following in order to set up this integration:
- a Salesforce org that is Enterprise, Unlimited, Performance, or Developer Edition.
- System Administrator access to set up the Connected App in Salesforce.
- 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:
- Expand the Authorization section of the HTTP request settings panel
- Set the type to Bearer Token
- Click in the Token field and press
{
to bring up a list of available properties - 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/
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/
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/
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:
