Configure Partner-Owned Routing and Consent

Routing and consent levels can be managed through the Salesforce system or the partner system. If routing and consent levels are managed through Salesforce.

To manage routing and consent levels through the Salesforce system:

  1. Set ConversationChannelDefinition.consentOwner to Salesforce.
  2. Set ConversationChannelDefinition.routingOwner to Salesforce and ConversationChannelDefinition.supportsKeywords to true.
  3. 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:

  1. Set ConversationChannelDefinition.consentOwner to Partner.

  2. Set ConversationChannelDefinition.routingOwner to Partner and ConversationChannelDefinition.supportsKeywords to false.

  3. Perform the API calls in the order listed:

    • 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.
  4. 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, set externallyRouted to true 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 set RoutingType to Transfer.
    • Call the agentWork API (POST /api/v1/agentWork) and set RoutingType to Transfer.

See Also