Skip to content

Commit 14ccada

Browse files
authored
Platform: Salesforce source connector (#384)
1 parent 16f8500 commit 14ccada

File tree

5 files changed

+70
-36
lines changed

5 files changed

+70
-36
lines changed

mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@
482482
"platform/sources/onedrive",
483483
"platform/sources/outlook",
484484
"platform/sources/s3",
485+
"platform/sources/salesforce",
485486
"platform/sources/sharepoint"
486487
]
487488
},

platform/connectors.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The Unstructured Platform supports connecting to the following source and destin
2323
- [OneDrive](/platform/sources/onedrive)
2424
- [Outlook](/platform/sources/outlook)
2525
- [S3](/platform/sources/s3)
26+
- [Salesforce](/platform/sources/salesforce)
2627
- [SharePoint](/platform/sources/sharepoint)
2728

2829
If your source is not listed here, you might still be able to connect Unstructured to it through scripts or code by using the

platform/sources/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ To create a source connector:
3030
- [OneDrive](/platform/sources/onedrive)
3131
- [Outlook](/platform/sources/outlook)
3232
- [S3](/platform/sources/s3)
33+
- [Salesforce](/platform/sources/salesforce)
3334
- [SharePoint](/platform/source/sharepoint)
3435

3536
8. If a **Continue** button appears, click it, and fill in any additional settings fields.
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Fill in the following fields:
22

33
- **Name** (_required_): A unique name for this connector.
4-
- **Username** (_required_): The Salesforce username that has access to the required Salesforce categories.
5-
- **Salesforce categories** (_required_): The Salesforce categories (objects) to access.
6-
- **Consumer Key** (_required_): The consumer key (client ID) for the Salesforce connected app.
4+
- **Username** (_required_): The Salesforce username that has access to the target Salesforce categories (objects).
5+
- **Salesforce categories**: A comma-separated list of the Salesforce categories to access. Available categories include
6+
`Account`, `Campaign`, `Case`, `EmailMessage`, and `Lead`.
7+
- **Consumer key** (_required_): The consumer key (client ID) for the target Salesforce connected app.
78
- **Private key (PEM)** (_required_): The private key (PEM) associated with the consumer key for the Salesforce connected app. The PEM is a string that begins with `—–BEGIN RSA PRIVATE KEY—–` and ends with `—–END RSA PRIVATE KEY—–`.
Lines changed: 63 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,67 @@
11
- A Salesforce account. [Create an account](https://developer.salesforce.com/signup).
2+
- Your Salesforce username.
3+
- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Campaign`, `Case`, `EmailMessage`, and `Lead`.
4+
- The OAuth consumer key (client ID) for the target Salesforce connected app in the account.
5+
- The contents of the private key (PEM) for the certificate that is associated for the Salesforce connected app. The PEM must be expressed as a
6+
single-line string without line breaks. To print this single-line string without line breaks, suitable for copying,
7+
you can run one of the following commands from your Terminal or Command Prompt. In this command, replace
8+
`<path-to-private-key-file>` with the path to the `.pem` file.
29

3-
<iframe
4-
width="560"
5-
height="315"
6-
src="https://www.youtube.com/embed/PIVPq2J1OMA"
7-
title="YouTube video player"
8-
frameborder="0"
9-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
10-
allowfullscreen
11-
></iframe>
12-
13-
- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Case`, `Campaign`, `EmailMessage`, and `Lead`.
14-
- The OAuth consumer key (client ID) and private key (PEM) for the Salesforce connected app. The PEM is a string that begins with `—–BEGIN RSA PRIVATE KEY—–` and ends with `—–END RSA PRIVATE KEY—–`. [Create a connected app](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm&type=5). [Get the consumer key](https://help.salesforce.com/s/articleView?id=sf.connected_app_rotate_consumer_details.htm&type=5). [Get the private key](https://help.salesforce.com/s/articleView?id=sf.task_create_a_certificate_and_private_key.htm&type=5).
15-
16-
<iframe
17-
width="560"
18-
height="315"
19-
src="https://www.youtube.com/embed/GcbcMsMV4oY"
20-
title="YouTube video player"
21-
frameborder="0"
22-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
23-
allowfullscreen
24-
></iframe>
25-
26-
<iframe
27-
width="560"
28-
height="315"
29-
src="https://www.youtube.com/embed/hFV2Ao4aXAY"
30-
title="YouTube video player"
31-
frameborder="0"
32-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
33-
allowfullscreen
34-
></iframe>
35-
10+
For macOS or Linux:
11+
12+
```bash
13+
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <path-to-private-key-file>
14+
```
15+
16+
For Windows:
17+
18+
```bash
19+
(Get-Content -Path "<path-to-private-key-file>" -Raw).Replace("`r`n", "\n")
20+
```
21+
22+
To get your Salesforce username, do the following:
23+
24+
1. Log in to your Salesforce account.
25+
2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**.
26+
3. In the search box, search for and go to **Users**.
27+
4. Note the **Name** value (_not_ the **User Name** value) for your user.
28+
29+
If you do not already have a Salesforce connected app, to create one, start by creating or getting the certificate (`.crt`) and private key (`.pem`) files
30+
that you will associate with the connected app. If you do not have the certificate and private key, you can use your local machine to create your own
31+
private key and self-signed certificate, if your organization allows, by running the following commands, one command at a time:
32+
33+
```bash
34+
openssl genrsa -out MyPrivateKey.pem -traditional
35+
openssl req -new -key MyPrivateKey.pem -out MyCertificateSigningRequest.csr
36+
openssl x509 -req -in MyCertificateSigningRequest.csr -signkey MyPrivateKey.pem -out MyCertificate.crt -days 365
37+
```
38+
39+
Be sure to store these generated files in a secure location.
40+
41+
To create a Salesforce connected app, do the following:
42+
43+
1. Log in to your Salesforce account.
44+
2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**.
45+
3. In the search box, search for and go to **App Manager**.
46+
4. Click **New Connected App**.
47+
5. With **Create a Connected App** selected, click **Continue**.
48+
6. At a minimum, fill in the following, and then click **Save**:
49+
50+
- **Connected App Name**
51+
- **API Name** (can be same as **Connected App Name**, but do not use spaces or punctuation)
52+
- **Contact Email**
53+
- Check **Enable OAuth Settings**.
54+
- For **Callback URL**, entering `http://localhost` is okay if you won't be using this connected app for other special authentication scenarios.
55+
- Check **Use Digital Signatures**. Click **Choose File**, and browse to and select your certificate (`.crt`) file.
56+
- For **Selected OAuth Scopes**, add **Manage user data via APIs (api)** (recommended) or **Full access (full)**.
57+
58+
To get the Salesforce connected app's consumer key, do the following:
3659

60+
1. Log in to your Salesforce account.
61+
2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**.
62+
3. In the search box, search for and go to **App Manager**.
63+
4. In the list of apps, click the arrow next to the target connected app, and click **View**.
64+
5. Click **Manage Consumer Details**.
65+
6. Complete the on-screen security verification.
66+
7. Note the **Consumer Key** value.
3767

0 commit comments

Comments
 (0)