Ingest your files into Unstructured from Salesforce.

The requirements are as follows.

  • A Salesforce account. Create an account.

  • 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 <path-to-private-key-file> with the path to the .pem file.

    For macOS or Linux:

    awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' <path-to-private-key-file>
    

    For Windows:

    (Get-Content -Path "<path-to-private-key-file>" -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:

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.

To create the source connector:

  1. On the sidebar, click Connectors.
  2. Click Sources.
  3. Cick New or Create Connector.
  4. Give the connector some unique Name.
  5. In the Provider area, click Salesforce.
  6. Click Continue.
  7. Follow the on-screen instructions to fill in the fields as described later on this page.
  8. Click Save and Test.

Fill in the following fields:

  • Name (required): A unique name for this connector.
  • 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—–.