diff --git a/mint.json b/mint.json index 7dd8714e..30cf7b53 100644 --- a/mint.json +++ b/mint.json @@ -478,6 +478,7 @@ "platform/sources/onedrive", "platform/sources/outlook", "platform/sources/s3", + "platform/sources/salesforce", "platform/sources/sharepoint" ] }, diff --git a/platform/connectors.mdx b/platform/connectors.mdx index 9cba991d..98d5c8e9 100644 --- a/platform/connectors.mdx +++ b/platform/connectors.mdx @@ -19,6 +19,7 @@ The Unstructured Platform supports connecting to the following source and destin - [OneDrive](/platform/sources/onedrive) - [Outlook](/platform/sources/outlook) - [S3](/platform/sources/s3) +- [Salesforce](/platform/sources/salesforce) - [SharePoint](/platform/sources/sharepoint) If your source is not listed here, you might still be able to connect Unstructured to it through scripts or code by using the diff --git a/platform/sources/overview.mdx b/platform/sources/overview.mdx index 5c91b937..f2ed785d 100644 --- a/platform/sources/overview.mdx +++ b/platform/sources/overview.mdx @@ -26,6 +26,7 @@ To create a source connector: - [OneDrive](/platform/sources/onedrive) - [Outlook](/platform/sources/outlook) - [S3](/platform/sources/s3) + - [Salesforce](/platform/sources/salesforce) - [SharePoint](/platform/source/sharepoint) 8. If a **Continue** button appears, click it, and fill in any additional settings fields. diff --git a/snippets/general-shared-text/salesforce-platform.mdx b/snippets/general-shared-text/salesforce-platform.mdx index c41adbb7..f771ce87 100644 --- a/snippets/general-shared-text/salesforce-platform.mdx +++ b/snippets/general-shared-text/salesforce-platform.mdx @@ -1,7 +1,8 @@ Fill in the following fields: - **Name** (_required_): A unique name for this connector. -- **Username** (_required_): The Salesforce username that has access to the required Salesforce categories. -- **Salesforce categories** (_required_): The Salesforce categories (objects) to access. -- **Consumer Key** (_required_): The consumer key (client ID) for the Salesforce connected app. +- **Username** (_required_): The Salesforce username that has access to the target Salesforce categories (objects). +- **Salesforce categories**: A comma-separated list of the Salesforce categories to access. Available categories include + `Account`, `Campaign`, `Case`, `EmailMessage`, and `Lead`. +- **Consumer key** (_required_): The consumer key (client ID) for the target Salesforce connected app. - **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—–`. \ No newline at end of file diff --git a/snippets/general-shared-text/salesforce.mdx b/snippets/general-shared-text/salesforce.mdx index 53b0289a..00ab3db6 100644 --- a/snippets/general-shared-text/salesforce.mdx +++ b/snippets/general-shared-text/salesforce.mdx @@ -1,37 +1,67 @@ - A Salesforce account. [Create an account](https://developer.salesforce.com/signup). +- Your Salesforce username. +- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Campaign`, `Case`, `EmailMessage`, and `Lead`. +- The OAuth consumer key (client ID) for the target Salesforce connected app in the account. +- 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 + single-line string without line breaks. To print this single-line string without line breaks, suitable for copying, + you can run one of the following commands from your Terminal or Command Prompt. In this command, replace + `` with the path to the `.pem` file. - - -- The Salesforce categories (objects) that you want to access, specified as a comma-separated list. Available categories include `Account`, `Case`, `Campaign`, `EmailMessage`, and `Lead`. -- 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). - - - - - + For macOS or Linux: + + ```bash + awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' + ``` + + For Windows: + + ```bash + (Get-Content -Path "" -Raw).Replace("`r`n", "\n") + ``` + +To get your Salesforce username, do the following: + +1. Log in to your Salesforce account. +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. +3. In the search box, search for and go to **Users**. +4. Note the **Name** value (_not_ the **User Name** value) for your user. + +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 +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 +private key and self-signed certificate, if your organization allows, by running the following commands, one command at a time: + +```bash +openssl genrsa -out MyPrivateKey.pem -traditional +openssl req -new -key MyPrivateKey.pem -out MyCertificateSigningRequest.csr +openssl x509 -req -in MyCertificateSigningRequest.csr -signkey MyPrivateKey.pem -out MyCertificate.crt -days 365 +``` + +Be sure to store these generated files in a secure location. + +To create a Salesforce connected app, do the following: + +1. Log in to your Salesforce account. +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. +3. In the search box, search for and go to **App Manager**. +4. Click **New Connected App**. +5. With **Create a Connected App** selected, click **Continue**. +6. At a minimum, fill in the following, and then click **Save**: + + - **Connected App Name** + - **API Name** (can be same as **Connected App Name**, but do not use spaces or punctuation) + - **Contact Email** + - Check **Enable OAuth Settings**. + - For **Callback URL**, entering `http://localhost` is okay if you won't be using this connected app for other special authentication scenarios. + - Check **Use Digital Signatures**. Click **Choose File**, and browse to and select your certificate (`.crt`) file. + - For **Selected OAuth Scopes**, add **Manage user data via APIs (api)** (recommended) or **Full access (full)**. + +To get the Salesforce connected app's consumer key, do the following: +1. Log in to your Salesforce account. +2. In the top navigation bar, click the **Quick Settings** (gear) icon, and then click **Open Advanced Setup**. +3. In the search box, search for and go to **App Manager**. +4. In the list of apps, click the arrow next to the target connected app, and click **View**. +5. Click **Manage Consumer Details**. +6. Complete the on-screen security verification. +7. Note the **Consumer Key** value.