Add Support for Custom Parameters
Use parameters, parameter mappings, and flows to route custom data to Salesforce objects. For example, pass the name of a Messaging end user to the messaging session object using a flow.
-
To pass custom parameters in the API, set the
capabilitiesSupportsCustomChannelParameters
field totrue
in ConversationChannelDefinition. -
Ask your admin to use the guidance in Route Data to Objects in Bring Your Own Channel to take these steps. Their business needs will be different than those in the example, so the exact flow logic will differ.
-
The admin should create an Omni-Channel flow with a variable that’s used to route data to an object. For example, use a variable named
newEndUserName
to update the Name field of a Messaging User object. -
Ask the admin for the DurableId of their flow. The DurableId always starts with 300 and is different from the FlowId.
-
In the Messaging Settings, the admin should create a custom parameter that matches the variable name in the Omni-Channel flow and add parameter mapping for the custom parameter. For example, the admin creates a custom parameter named newEndUserName and maps it. When the admin creates the new parameter and mapping, ask them to note the Channel Variable Name.
-
-
To route the flow if your implementation uses partner owned routing (
ConversationChannelDefinition.routingOwner
isPartner
), make a call to the Interaction Service Route Conversation API (POST /api/v1/route
).- Set
routingType
toInitial
, and pass in the target flow ID and fallback queue ID throughroutingInfo.flow
. - Use the
routingAttributes
parameter to pass the key-value pair for the flow variable in the format"routingAttribute" : "key" : "value"
, wherekey
is the channel variable name in the parameter mapping, andvalue
is the value.
In the sample payload, in routingAttributes the key is set to
newEndUserName
which is mapped to the inputnewEndUserName
parameter in Salesforce.Here is a sample payload for
POST /api/v1/route
. - Set
See Also
- Salesforce Help: Route Data to Objects in Bring Your Own Channel
- Salesforce Help: Understand the Details of the Routing Lifecycle
- Interaction Service API
- GitHub: Interaction Service APIs