Einstein Bots SDK

Use Einstein Bots API (Beta) to link your external messaging channels with your Einstein Bots. Use the Einstein Bots Java SDK to integrate your channel with the Einstein Bots API. This SDK guide is for API version 5.

If you use Spring Boot, you can connect your app to the SDK through the Channel Connector Framework. If not, use the SDK directly.

The Java SDK simplifies integrating your service client with the bot’s REST API. Here are the features that the SDK provides.

Authentication mechanism

Einstein Bots API requires the client to authenticate requests using OAuth. The SDK uses the JWT Bearer OAuth Flow as a default, but any OAuth flow can be used to get the access token (see AuthMechanism interface).

Session management

You only need the external session ID, such as a Twitter thread ID, to track the bot session. The client maps the external session ID to the internal session ID in the cache. The Einstein Bots API has separate calls to start a session and send subsequent messages. The session-managed client simplifies the calls by having one method to start and continue a session.

Caching mechanism

The SDK uses a cache to store the mapping between the ExternalSessionId and internal RuntimeSessionId. We support the Redis cache manager by default. You can implement additional caching methods with the Cache interface.

DTO classes

The SDK provides DTO classes with strict type checking to serialize and deserialize JSON request and response bodies.

DSL-style methods

The SDK provides DSL-style methods so that you can write more readable code.