LinkedIn
Copied!

Table of Contents

Third-party Routing API

Version:

Only available versions of this content are shown in the dropdown

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

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 connector Description
cyFetchExternalRoute Sends the chat request metadata to the external routing system.
cyPostRoutingEvents Sends 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 service Description
PostRoutingEvents Performs 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

Name Required/Optional Description
_conversation_id Required The chat or messaging request ID
_queue_name Required The queue ID where the request is processed
_source Required The name of a chat channel or any supported unified messaging channel
_preferred_agent Optional The 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

Parameter Required/Optional Description
_status Required The 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_time Optional The average wait time for the request
_source Required The name of a chat channel or any supported unified messaging channel
_queue_position Optional The current position of the request

Example response

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

Error codes

Error code Description
400 Bad request
500 Server not found

Extension or customization points

Data transform Purpose Available page Parameters
ChannelServices-Conversation-Queued. cyParseConversationResquest Adds 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_time Adds 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

Parameter Required/Optional Description
_conversation_id Optional The chat or messaging request ID
_agent_name Required The name of the CSR who is assigned the request
_event_name Required The CSR action on the request
_queue_name Optional The queue ID where the request is processed
_source Optional The name of the channel from which the request originated

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

_transferred_from_agent Optional The name of the CSR who initiated the transfer
_ transferred_to_agent Optional The name of the CSR who received the transfer
_ transferred_to_queue Optional The name of the queue that received the transfer request
_ transferred_from_queue Optional The 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":"lara@pegasystems.com", "_transferred_to_agent":"Sara", "_transferred_to_queue":"Technical", "_transferred_from_queue":"Billing" }

Response parameters

Parameter Required/Optional Description
_status Required The status of the transfer request (Success or Fail)

Example response

{ "_status":"Success" }

Error codes

Error code Description
400 Bad request
500 Server not found

Extension or customization points

Data transform Purpose Available page Parameters
ChannelServices-Int-Routing. cyParseEventsRequestExtn Adds 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.

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

Parameter Required/Optional Description
_conversation_id Required The chat or messaging request ID
_agent_id Required The name of the CSR that is identified by the third-party routing system

Example request

{ "_conversation_id":"3bc1c3b45ea911ea88f277fee9bcd8c0", "_agent_id":"lara@pegasystems.com" }

Response parameters

Parameter Required/Optional Description
_status Required The status of the transfer request (Success or Fail)

Example response

{ "_status":"Success" }

Error codes

Error code Description
400 Bad request
500 Server not found

Extension or customization points

Data transform Purpose Available page Parameters
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 Collaboration Center to ask questions, engage in discussions, share ideas, and help others.