Configure Partner-Owned Routing and Consent
Routing and consent levels can be managed through the Salesforce system or the partner system. There are several possible scenarios.
- Manage routing and consent levels through Salesforce.
- Manage routing and consent levels through the partner system.
- Manage routing through the partner system and consent levels through Salesforce.
To manage routing and consent levels through the Salesforce system:
- Set
ConversationChannelDefinition.routingOwner
toSalesforce
. - Set
ConversationChannelDefinition.consentOwner
toSalesforce
andConversationChannelDefinition.supportsKeywords
totrue
. IfConversationChannelDefinition.supportsKeywords
isfalse
, only Implicit Opt-In consent is available for the Messaging channel. - After the admin installs the managed package and sets everything up, they can navigate to the Messaging Settings page in Salesforce Lightning to configure the routing and consent level details.
To manage routing and consent levels through the partner system:
-
Set
ConversationChannelDefinition.routingOwner
toPartner
. -
Set
ConversationChannelDefinition.consentOwner
toPartner
andConversationChannelDefinition.supportsKeywords
tofalse
. -
Perform the API calls in the order listed when the end user initiates a conversation:
- Call the Interaction API (
POST /api/v1/interactions
) to create a conversation messaging session and a messagingEndUser record. - Call the Consent API (
PATCH /api/v1/consent
) and set the consent level (consentStatus
) for the user. For example, “consentStatus” : “ExplicityOptedIn”. - Call the Route API (
POST /api/v1/route
) to generate a Pending Service Routing (PSR) record in Salesforce. - Call the AgentWork API (
POST /api/v1/agentWork
) to create an AgentWork record when the system finds a potential agent to handle the work item. - Call the Route API (
DELETE /api/v1/route
) to delete the Pending Service Routing (PSR) record. Only call this API if the PSR isn’t automatically deleted.
- Call the Interaction API (
-
Perform the API calls in the order listed when the agent clicks on the transfer target. The RoutingRequested event is received through the custom platform event.
- Call the RoutingResult api (
POST /api/v1/routingResult
). If the event is being routed to an external target outside the Salesforce org, setexternallyRouted
totrue
and end the flow. If the event is being managed through Omni-Channel routing, move on to the next step. - Call the Route API (
POST /api/v1/route
) and setRoutingType
toTransfer
. - Call the AgentWork API (
POST /api/v1/agentWork
) and setRoutingType
toTransfer
.
- Call the RoutingResult api (
To manage routing through the partner system and consent levels through Salesforce:
-
Set
ConversationChannelDefinition.routingOwner
toPartner
. -
Set
ConversationChannelDefinition.consentOwner
toSalesforce
andConversationChannelDefinition.supportsKeywords
totrue
. IfConversationChannelDefinition.supportsKeywords
isfalse
, only Implicit Opt-In consent is available for the Messaging channel. -
Perform the API calls in the order listed when the end user initiates a conversation:
- Call the Interaction API (
POST /api/v1/interactions
) to create a conversation messaging session and a messagingEndUser record. - Call the Route API (
POST /api/v1/route
) to generate a Pending Service Routing (PSR) record in Salesforce. - Call the AgentWork API (
POST /api/v1/agentWork
) to create an AgentWork record when the system finds a potential agent to handle the work item. - Call the Route API (
DELETE /api/v1/route
) to delete the Pending Service Routing (PSR) record. Only call this API if the PSR isn’t automatically deleted.
- Call the Interaction API (
-
Perform the API calls in the order listed when the agent clicks on the transfer target. The RoutingRequested event is received through the custom platform event.
- Call the RoutingResult api (
POST /api/v1/routingResult
). If the event is being routed to an external target outside the Salesforce org, setexternallyRouted
totrue
and end the flow. If the event is being managed through Omni-Channel routing, move on to the next step. - Call the Route API (
POST /api/v1/route
) and setRoutingType
toTransfer
. - Call the AgentWork API (
POST /api/v1/agentWork
) and setRoutingType
toTransfer
.
- Call the RoutingResult api (
-
After the admin installs the managed package and sets everything up, they can navigate to the Messaging Settings page in Salesforce Lightning to configure the consent level details.
See Also
- Create the Conversation Channel Definition Record
- Configure Consent Levels to Customize the Messaging Opt-In and Opt-Out Experience
- GitHub: Interaction Service APIs
- Object Reference: messagingEndUser
- Salesforce Help: Customize the Messaging Opt-In and Opt-Out Experience
- Salesforce Help: Understand the Details of the Routing Lifecycle