Track the Routing Status of a Conversation

Notifies Salesforce about external routing results.

This API notifies Salesforce whether a conversation has successfully routed to a rep or failed to route. Use the results to determine whether to close the AgentWork record if routing succeeds or initiate another request if routing fails. This API doesn’t handle the transfer behavior after receiving the routing result event.

Routing can fail for various reasons. For example, routing can fail if the external routing system can’t fulfill the request. Routing will also fail if the receiving rep is busy or the external routing system doesn’t respond within 60 seconds after the request was sent. If it takes a while for the system to find a potential rep or queue to handle the work item, call this API before calling the Create an AgentWork Record (/agentWork) API.

This API applies to the following product:

  • Bring Your Own Channel for Contact Center as a Service

This API is available in version 62.0 and later.

v1/routingResult

POST

Format: Bearer <Salesforce Access Token>
String. Standard header. Used to authenticate the user, where <Salesforce Access Token> is the Salesforce access token used as the bearer token to make requests to the Interaction Service APIs. Required.

Format: application/json
String. Standard header. Format of the request payload. Required for any request that includes a body.

Format: <Salesforce Org ID>
String. Custom header. The Salesforce org. <Salesforce Org ID> is the 15-character Org ID of the Salesforce org. Required.

Format: <UUID>
String. Custom header. Universally Unique Identifier (<UUID>) that references and tracks this request. Required.

Format: <AuthorizationContext>
String. Custom header. Additional information for the request authorization used to authenticate and validate requests against the connected app scopes.

  • For Bring Your Own Channel for CCaaS, set <AuthorizationContext> to the developer name of the ConversationChannelDefinition record. For example, Partner1_ChannelDefinition1. Required.
Property NameTypeDescriptionRequired
workItemIdstringThe unique ID for the associated MessagingSession record. The ID is 15 characters long.Yes
conversationIdentifierstringThe unique ID for the conversation channel.Yes
successbooleanIndicates whether routing succeeded (true) or failed (false). If set to false, also set the errorMessage parameter.Yes
externallyRoutedbooleanIndicates whether this request is being routed to an external target outside the Salesforce org (true) or internally through Omni-Channel routing (false). Default value is true.Yes
errorMessagestringThe message that’s sent to the rep stating why routing failed. Only set this field if “success” : “false".No

Send a request from the partner telephony system to Salesforce when the conversation fails to route (via partner-owned routing) to the target rep.

Send a request from the partner telephony system to Salesforce when the conversation successfully routes (via partner-owned routing) to the target rep.