Skip to main content
Skip table of contents

Conversation API

API Rules within AppBase are a preconfigured framework that allows users to interact with the Genesys Conversation API more efficiently and effectively. These rules encapsulate a range of functionalities and best practices, ensuring that users can seamlessly communicate with and control the Genesys Conversation API without requiring extensive manual configuration or coding.

The Genesys Conversation API, in this context, is a powerful tool for managing and orchestrating conversations, interactions, and communication processes within the Genesys platform. It offers many features and capabilities, such as routing customer interactions to the right agents, tracking conversation histories, gathering valuable customer data, and much more.

By integrating these prebuilt API Rules into AppBase, users can easily harness the Genesys Conversation API's full potential. These rules might include predefined request and response formats, authentication mechanisms, error handling procedures, and other essential components that are essential for successful API communication.


GEN_createConversation

The rule creates email conversations in Genesys according to a configuration in Genesys Settings.

Create with input params:

  • ASF.BDS.Rules.Common.RuleRequest - request of rule
  • DCM.Genesys.Models.ConversationCreateRequest (see input params of rule)
  • userCode - Access Subject Code of Current User

Input Params:

  • QueueName (Required): Queue name in Genesys
  • Provider (Required): Provider. For example, DCM
  • Priority: Priority of the interaction
  • SkillIds (DCM 7.1.5+): Separated comma ID of Skills. For example: 1fab838a-1a12d2f1234, b20fc909-065f721f1234
  • SkillNames (DCM 7.2+): Separated comma name of Skills.
  • CustomCaseDetailUrl: If we need to open a custom case detail page instead of the default. For example, DCM Url should be in the following format (because the system shows interaction pages in embedded mode): /Ecx.Web?pageCode={params of page}
  • Subject
  • ToAddress
  • ToName
  • FromAddress
  • FromName

Output

  • ConversationId: Id of the created email interaction
  • ErrorCode
  • ErrorMessage
  • SuccessResponse

GEN_disconnectConversation

Rule sends the active participants to the Disconnected state

Input Params:

  • ConversationId (Required)Id of the conversation.

Output

  • ErrorCode
  • ErrorMessage
  • SuccessResponse

GEN_transferToQueue

Rule transfers conversation to queue

Input Params:

  • ConversationId (Required)Id of the conversation.
  • QueueId (Required)Id of the queue.

Output

  • ErrorCode
  • ErrorMessage
  • SuccessResponse

GEN_assignToUser

Rule assigns conversation to the user.

Input Params:

  • ConversationId (Required)Id of the conversation.
  • UserId (Required)Id of the user.

Output

  • ErrorCode
  • ErrorMessage
  • SuccessResponse

GEN_getConversationJson

This rule returns the conversation in JSON.

Input Params:

  • ConversationId (Required)Id of the conversation.

Output

  • ErrorCode
  • ErrorMessage
  • Result: JSON of conversation

Methods in Extensions

Before executing these methods, you should init auth token:

C#
using DCM.GenesysHelper.Services;

string pureCloudUrl = ConfigurationManager.AppSettings.Get("PURECLOUD_URL");
string clientId = ConfigurationManager.AppSettings.Get("PURECLOUD_CLIENTID");
string clientSecretId = ConfigurationManager.AppSettings.Get("PURECLOUD_CLIENTSERCRETID");
int regionHost = DcmConvertHelper.SafeObjectToInt(ConfigurationManager.AppSettings.Get("PURECLOUD_REGIONHOST"));

AuthService authService = new AuthService();
authService.SetAuthToken(pureCloudUrl, clientId, clientSecretId, (PureCloudRegionHosts)regionHost);

How to get debug enabled flag. Debug data will be available in Conversation History (if we have ConversationId) or the system monitor.

C#
string result = request.AsString("GEN_ADVANCED_LOGGING");
bool isDebugEnabled = result == "1";


MethodDefinitions

DCM.GenesysHelper.Services.ConversationService.Get

Description: Returns basic information about an existing Genesys Conversation. 

Input:

  • ConversationId: string
  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.Conversation

Example:

C#
using DCM.GenesysHelper.Services;

string interactionId = "";  

ConversationService interactionService = new  ConversationService();
var interaction = interactionService.Get(interactionId);

DCM.GenesysHelper.Services.ConversationService.Get

Description: Simplified search Conversations in Genesys by IDs.

Input:

  • ConversationIds: List<string>
  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.AnalyticsConversationWithoutAttributesMultiGetResponse

Example:

C#
using DCM.GenesysHelper.Services;

var ids = new List<string>();
ids.Add(interactionId1);
ids.Add(interactionId2);  

ConversationService interactionService = new  ConversationService();
var result = interactionService.Get(ids);

DCM.GenesysHelper.Services.ConversationService.Assign

Description: Attempts to manually assign a specified conversation to a specified user. Ignores bullseye ring, PAR score, skills, and languages.

Input:

  • ConversationId: string
  • UserId: string
  • isDebugEnabled: bool

Output:

  • result: string 

Example:

C#
using DCM.GenesysHelper.Services;    

ConversationService service = new  ConversationService ();
string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
string userId = ConfigurationManager.AppSettings.Get("UserId");
var result = service.Assign(interactionId, userId);

DCM.GenesysHelper.Services.ConversationService.TransferToQueue

Description: Attempts to manually assign a specified conversation to a specified queue.

Input:

  • ConversationId: string
  • QueueId: string
  • isDebugEnabled: bool

Example:

C#
using DCM.GenesysHelper.Services;


ConversationService interactionService = new  ConversationService ();
string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
string queueId = ConfigurationManager.AppSettings.Get("QueueId");
var result = service.TransferToQueue(interactionId,  queueId );
DCM.GenesysHelper.Services.ConversationService.SetWrapUpCode

Description: Sets the Wrap-Up Code for a specific Participant in a Conversation. It's important to understand that a Conversation will have a Wrap-Up Code for User involved in the Conversation.

Input:

  • ConversationId: string
  • ParticipantId: string
  • WrapUpCode: string
  • isDebugEnabled: bool

Example:

C#
using DCM.GenesysHelper.Services;
   
ConversationService interactionService = new  ConversationService();

string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
string paticipantId = ConfigurationManager.AppSettings.Get("ParticipantId");
string wrapUpCode = ConfigurationManager.AppSettings.Get("WrapUpCode");
interactionService.SetWrapUpCode(interactionId, paticipantId, wrapUpCode);
DCM.GenesysHelper.Services.ConversationService.SetWrapUpCodeAndDisconnect

Description: Sets the Wrap-Up Code for a specific Participant in a Conversation. It's important to understand that a Conversation will have a Wrap-Up Code for User involved in the Conversation.

Input:

  • ConversationId: string
  • ParticipantId: string
  • WrapUpCode: string
  • isDebugEnabled: bool

Example:

C#
using DCM.GenesysHelper.Services;    

ConversationService interactionService = new  ConversationService();

string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
string paticipantId = ConfigurationManager.AppSettings.Get("ParticipantId");
string wrapUpCode = ConfigurationManager.AppSettings.Get("WrapUpCode");
            interactionService.SetWrapUpCodeAndDisconnect(interactionId, paticipantId, wrapUpCode);
DCM.GenesysHelper.Services.ConversationService.GetConversationState

Description: Returns the overall state of the Conversation. Values can be:

  • alerting
  • dialing
  • contacting
  • offering
  • connected
  • disconnected
  • terminated
  • converting
  • uploading
  • transmitting
  • none

Input:

  • ConversationId: string
  • isDebugEnabled: bool

Output:

  • State: string

Example:

C#
using DCM.GenesysHelper.Services;    

ConversationService interactionService = new  ConversationService();

string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
var result = interactionService.GetConversationState(interactionId);

Examples

https://gitlab.appbase.com/dcm/extensions/blob/develop/Extensions/Tests/DCM.Extensions.Tests/GenesysHelper/ConversationHelperFixturecs


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.