Step 4: Create the External Bot Definition and Vendor Integration Records
The Vendor Integration (ExtConvParticipantIntegDef) and External Bot Definition (ExternalConversationBotDef) records contain the metadata needed to connect your external bot to Salesforce. Use your preferred method, such as Metadata API or Tooling API, and the sample payload to create the record.
This section outlines the steps to create essential entity records in Salesforce using Tooling API. It shows you how to create both the ExtConvParticipantIntegDef and ExternalConversationBotDef records. These records are important for making sure your external bot connects to Salesforce.
Bring Your Own Bot (BYOB) requires Salesforce API version 64.0 or later. The examples below use v64.0. Use a later version if your org supports one.
Use Tooling API to create the ExtConvParticipantIntegDef record.
Method: POST
URI: /services/data/v64.0/tooling/sobjects/ExtConvParticipantIntegDef
In the payload, masterLabel can be any value, and developerName is the API name of the external client app you created.
The customEventPayloadField, customEventTypeField, and customPlatformEvent are the API names of the custom fields you created. The customPlatformEvent is the API name of the platform event created above.
Save the returned record ID for creating ExternalConversationBotDef.
If you encounter INVALID_SESSION_ID issues, use the Metadata API via Workbench (Utilities tab).
Use Tooling API to create the ExternalConversationBotDef record.
Method: POST
URI: /services/data/v64.0/tooling/sobjects/ExternalConversationBotDef
In the payload, extConvParticipantIntegDefId is the record ID that was returned when you created the ExtConvParticipantIntegDef record.
After you create the entity records, configure Salesforce Flow with the RouteWork action.