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. -
In Messaging Settings, the admin should create a custom parameter that matches the variable name in the Omni-Channel flow and add a 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 send a message while passing the parameter and its value to the object, make a call to the Interaction Service Interactions API (
POST /api/v1/interactions
). Use theroutingAttributes
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/interactions
.
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