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:

  1. Set ConversationChannelDefinition.routingOwner to Salesforce.
  2. Set ConversationChannelDefinition.consentOwner to Salesforce and ConversationChannelDefinition.supportsKeywords to true. If ConversationChannelDefinition.supportsKeywords is false, only Implicit Opt-In consent is available for the Messaging channel.
  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.routingOwner to Partner.

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

  3. 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.
  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.

To manage routing through the partner system and consent levels through Salesforce:

  1. Set ConversationChannelDefinition.routingOwner to Partner.

  2. Set ConversationChannelDefinition.consentOwner to Salesforce and ConversationChannelDefinition.supportsKeywords to true. If ConversationChannelDefinition.supportsKeywords is false, only Implicit Opt-In consent is available for the Messaging channel.

  3. 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.
  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.
  5. 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