Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Third-party Routing API

Updated on January 29, 2021

With the Third-party routing API, you can use an external routing system for Pega Customer Service chat and messaging requests.

Pega Customer Service Implementation Guide Pega Customer Service Implementation Guide Pega Customer Service Implementation Guide Pega Customer Service Implementation Guide
If you have a shared pool of CSRs to attend Pega Call and Pega Customer Service chat and messaging requests, you can select this option to use the Pega Call routing services to route the chat and messaging requests.

When you select external routing, Pega Customer Service application redirects the queued chat requests to the configured external service URL as event notifications. The application also notifies the changes in the CSR availability to accept new requests. Pega Customer Service exposes a REST service over which the external routing system can communicate the final routing decision.

The third-party routing API uses the following REST connectors and services:

Third-party API REST connectors

REST connectorDescription
cyFetchExternalRouteSends the chat request metadata to the external routing system.
cyPostRoutingEventsSends the CSR actions or the conversation changes to the external routing system after a CSR is offered the request.

Third-party API REST services

REST serviceDescription
PostRoutingEventsPerforms post-routing actions when a CSR is identified.

cyFetchExternalRoute connector

Use the cyFetchExternalRoute to send the chat and messaging request metadata to an external routing system.

Request parameters

NameRequired/OptionalDescription
_conversation_idRequiredThe chat or messaging request ID
_queue_nameRequiredThe queue ID where the request is processed
_sourceRequiredThe name of a chat channel or any supported unified messaging channel
_preferred_agentOptionalThe name of the preferred CSR who handled the chat previously if in an asynchronous channel

Example request

{ "_conversation_id": "3bc1c3b45ea911ea88f277fee9bcd8c0",
                "_queue_name": "Billing",
                "_source": "Facebook",
                "_preferred_agent": "" }

Response parameters

ParameterRequired/OptionalDescription
_statusRequiredThe status of the routing activity

The following values are supported:

  • _identifying_route: The third-party routing system accepted the request and is searching for a CSR.
  • route_not_found: No CSRs are available to accept the request.
_wait_timeOptionalThe average wait time for the request
_sourceRequiredThe name of a chat channel or any supported unified messaging channel
_queue_positionOptionalThe current position of the request

Example response

{
   "_status":"_identifying_route",
   "_wait_time":"",
   "_queue_position":""
}

Error codes

Error codeDescription
400Bad request
500Server not found

Extension or customization points

Data transformPurposeAvailable pageParameters
ChannelServices-Conversation-Queued. cyParseConversationResquestAdds more details to the request, such as a customer name or a customer policy number.Primary (ChannelServices-Conversation-Queued)
  • JSON data: The incoming or outgoing JSON data
  • Execution mode: The mode to execute mapping (Serialize or Deserialize)
ChannelServices-Conversation-Queued. cyParseConversationResponse_wait_timeAdds more details to the response, such as queue capacity or an active agents count.Primary (ChannelServices-Conversation-Queued)
  • JSON data: The incoming or outgoing JSON data
  • Execution mode: The mode to execute the mapping (Serialize or Deserialize)

cyPostRoutingEvents connector

Use the cyPostRoutingEvents connector to send the updates on CSR availability and CSR or customer actions to the external routing system for routing pending and transfer requests.

Request parameters

ParameterRequired/OptionalDescription
_conversation_idOptionalThe chat or messaging request ID
_agent_nameRequiredThe name of the CSR who is assigned the request
_event_nameRequiredThe CSR action on the request
_queue_nameOptionalThe queue ID where the request is processed
_sourceOptionalThe name of the channel from which the request originated

The source can be chat or any supported unified messaging channel.

_transferred_from_agentOptionalThe name of the CSR who initiated the transfer
_ transferred_to_agentOptionalThe name of the CSR who received the transfer
_ transferred_to_queueOptionalThe name of the queue that received the transfer request
_ transferred_from_queueOptionalThe name of the queue from which the transfer originated

Example request

{
   "_conversation_id":"3bc1c3b45ea911ea88f277fee9bcd8c0",
   "_agent_name":"Sara",
   "_event_name":"Transfer-to-agent-accepted",
   "_queue_name":"Billing",
   "_source":"chat",
   "_transferred_from_agent":"[email protected]",
   "_transferred_to_agent":"Sara",
   "_transferred_to_queue":"Technical",
   "_transferred_from_queue":"Billing"
}

Response parameters

ParameterRequired/OptionalDescription
_statusRequiredThe status of the transfer request (Success or Fail)

Example response

{
   "_status":"Success"
}
            

Error codes

Error codeDescription
400Bad request
500Server not found

Extension or customization points

Data transformPurposeAvailable pageParameters
ChannelServices-Int-Routing. cyParseEventsRequestExtnAdds more details to the request, such as the current time stamp or the reason for transfer.Primary (ChannelServices-Conversation-Queued)
  • JSON data: The incoming or outgoing JSON data
  • Execution mode: The mode to execute the mapping (Serialize or Deserialize)

PostingRoutingEvents service

Use the PostingRoutingEvents service to perform post-routing activities after a route is identified.

The external routing system uses the following URL to access the PostingRoutingEvents service:{{base_url}}/prweb/api/ConversationRouting/V1/PostRoutingEvents

{{base_url}} takes the value that is specific to the URL of the customer instance.

For example: If the customer instance is http://10.225.93.236:9080/prweb/app/, then the {{base_url}} is http://10.225.93.236:9080.

Request parameters

ParameterRequired/OptionalDescription
_conversation_idRequiredThe chat or messaging request ID
_agent_idRequiredThe name of the CSR that is identified by the third-party routing system

Example request

{
   "_conversation_id":"3bc1c3b45ea911ea88f277fee9bcd8c0",
   "_agent_id":"[email protected]"
}

Response parameters

ParameterRequired/OptionalDescription
_status RequiredThe status of the transfer request (Success or Fail)

Example response

{
   "_status":"Success"
}
            

Error codes

Error codeDescription
400Bad request
500Server not found

Extension or customization points

Data transformPurposeAvailable pageParameters
ChannelServices-Conversation-Queued. cyParseConversationRouteResponse Adds more details, such as CSR capacity or CSR’s active interactions.Primary (ChannelServices-Conversation-Queued)
  • JSON data: The incoming or outgoing JSON data
  • Execution mode: The mode to execute the mapping (Serialize or Deserialize)

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us