Skip to main content

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

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Chat APIs for third-party integration

Updated on September 13, 2021

Pega implementations use third-party applications for a chat along with the Pega Customer Service application. In such scenarios, synchronizing data between applications is required to maintain proper application context. In many cases, customized and siloed APIs are used to synchronize customer data and interaction data between the third party and the Pega Customer Service application. This approach to supporting each added application in the enterprise layer increases the maintenance costs and the manpower that is needed to fix bugs that are specific to an application.

Pega Customer Service 8.1 provides a standardized, generic set of JavaScript API to communicate and synchronize the data between various applications. The JavaScript APIs support the following actions.

  • Create interaction – Used to create an interaction.
    • Syntax: pega.CS.startInteraction(<Interaction Class name>,<Flow name>,{<Flow params and additional params>}, callback)
    • Example: pega.CS.startInteraction("PegaCA-Work-Interaction-Call","CPMInteraction”, {ContactId:"CONT-1”, AccountNumber:"xxxxxxxxxxxxx",IsExternalAPICall:"true"},function(data){ console.log(data);})
    • To create an interaction object whenever an API is called, update the SetInteractionDetails data transform by setting the When condition with the IsExternalAPICall:"true parameter.
  • Switch interaction – Used to switch between multiple interactions.
    • Syntax: pega.CS. switchInteraction (<Interaction ID>, callback)
    • Example: pega.CS.switchInteraction("I-123", function(data){ console.log(data);})
  • End interaction – Used to close any open interaction object.
    • Syntax: pega.CS. endInteraction (<Interaction ID>, callback)
    • Example: pega.CS.endInteraction("I-456", function(data){ console.log(data);})

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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us