Set Up the Dependency and Config Variables

To run the Einstein Bots SDK, add this POM dependency to your pom.xml. For <version>, use the latest Einstein Bots SDK Java version.

Then set up these configuration variables.

Here’s how you find the configuration values.

  • basePath: The runtime base URL found in the Add Connection dialog when you add the connected app to the bot (see Get Started with Einstein Bots API).
  • orgId: The 18 character org ID of the Salesforce org that is associated with the bot. To get the org ID:
    1. Find your Salesforce Organization ID (15 characters long).
    2. Then convert it from the 15 to 18 character version. You can find Salesforce org ID converters using any search engine.
  • botId: The bot ID found on the Bot Overview Page.
  • forceConfigEndPoint: The forceConfig endpoint found in the Add Connection dialog when you add the connected app to the bot (see Get Started with Einstein Bots API).
  • loginEndpoint: The Salesforce login endpoint. This is https://login.salesforce.com for the production org and https://test.salesforce.com for a sandbox org.
  • connectedAppId: The consumer key of your connector app setup.
  • secret: The consumer secret of connector app setup.
  • userId: The user ID that you use to log in to Salesforce.
  • privateKeyFilePath: Required for the JTW bearer flow. The private key that you used to create the public certificate and uploaded to the connected app for the OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration. If your private key is in PEM format, convert it to a DER format using this command.

NOTE: The private key is required only for the JWT bearer flow. If you aren’t using the JWT bearer flow, provide your own authorization mechanism.