Skip to main content
Skip table of contents

Routing API

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_findQueues

This rule finds Genesys queues by name.

Input Params:

  • QueueName (Required): Queue name in Genesys

Output Params:

  • ErrorCode
  • ErrorMessage
  • Queues: JSON list of queues.

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.RoutingService.GetQueueId

Description: Returns the QueueId by queue name

Input:

  • queueName: string

  • isDebugEnabled: bool

Output:

  • string

Example:

C#
using DCM.GenesysHelper.Services;  
 
string queueName = ConfigurationManager.AppSettings.Get("PURECLOUD_QUEUE");
string id = new RoutingService().GetQueueId(queueName);

DCM.GenesysHelper.Services.RoutingService.GetQueues

Description: Searches all Genesys Queues, that are the "work baskets" for Genesys Conversations.

Input:

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • sOrder: string

  • queueName: string

  • queueIds: List<string>

  • divisionIds: List<string>

  • peerIds: List<string>

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.Queue>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string queueName = ConfigurationManager.AppSettings.Get("PURECLOUD_QUEUE");
var result = new RoutingService().GetQueues(1, 100, null, queueName);

DCM.GenesysHelper.Services.RoutingService.GetUsersInQueue

Description: Returns list of all Users that are members of a queue.

Input:

  • queueId: string

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • routingStatus: List<string>

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.QueueMember>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string queueId = ConfigurationManager.AppSettings.Get("QueueId");
var result = new RoutingService().GetUsersInQueue(queueId, 1, 100, null, null);
DCM.GenesysHelper.Services.RoutingService.GetUserQueues

Description: Returns all Queues the User is a member of.

Input:

  • userId: string

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.UserQueue>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string userId = ConfigurationManager.AppSettings.Get("UserId");
var result = new RoutingService().GetUserQueues(userId);
DCM.GenesysHelper.Services.RoutingService.GetWrapupCodes

Description: Wrap-Up Codes are like Resolution Codes on a Conversation Session. Every Queue has a list of available Wrap Up Codes.

Input:

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • sortBy: string

  • sortOrder: string

  • name: string

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.WrapupCode>

Example:

C#
using DCM.GenesysHelper.Services;  
 
var result = new RoutingService().GetWrapupCodes();
DCM.GenesysHelper.Services.RoutingService.GetWrapupCodes

Description: This API should return all Wrap-Up Codes for a specific Queue. It can do a search by ID or by an exact match of the Queue Name.

Input:

  • queueId: string

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.WrapupCode>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string queueId = ConfigurationManager.AppSettings.Get("QueueId");
var result = new RoutingService().GetWrapupCodes(queueId);
DCM.GenesysHelper.Services.RoutingService.CreateWrapupCode

Description: This API should create a Wrap-Up Code. This is a unique requirement for one of our customers.

Input:

  • wrapupCode: string

  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.WrapupCode

Example:

C#
using DCM.GenesysHelper.Services;  

var result = new RoutingService().CreateWrapupCode("TestWrapUpCode");

DCM.GenesysHelper.Services.RoutingService.AddWraUpCodesToQueue

(DCM 7.2+)

Description: Add up to 100 wrap-up codes to a queue.

Input:

  • wrapUpCodes: List<string> - WrapUp Code Ids

  • queueId: String

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.WrapupCode> (Added WrapUpCodes)

Example:

C#
using DCM.GenesysHelper.Services;    
 
string queueId = "";
string wrapUpCode1Id = "";
string wrapUpCode2Id = "";
 
var wrapupCodes = routingService.AddWraUpCodesToQueue(new List<string>() { wrapUpCode1Id, wrapUpCode2Id }, queueId);
DCM.GenesysHelper.Services.RoutingService.GetSkills

Description: Searches all Skills.

Input:

  • skillId: string
  • skillName: string
  • pageNumber: string (default: 1)
  • pageSize: string( default: 100)
  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.RoutingSkill>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string skillId = ConfigurationManager.AppSettings.Get("SkillId");
string skillName = ConfigurationManager.AppSettings.Get("SkillName");
var result = new RoutingService().GetSkills(new List<string>(){ skillId }, skillName);
DCM.GenesysHelper.Services.RoutingService.GetUserSkills

Description: Returns all Routing Skills a User has.

Input:

  • userId: string

  • pageNumber: string (default: 1)

  • pageSize: string( default: 100)

  • sOrder: string

  • isDebugEnabled: bool

Output:

  • List<PureCloudPlatform.Client.V2.Model.UserRoutingSkill>

Example:

C#
using DCM.GenesysHelper.Services;  
 
string userId = ConfigurationManager.AppSettings.Get("UserId");
var result = new RoutingService().GetUserSkills(userId);
DCM.GenesysHelper.Services.RoutingService.GetQueueEstimatedWaitTime

Description: Returns the estimated time it would take a Conversation in a queue to be handled by an agent. If "QueueId" is provided, it estimates the wait time for a new Conversation. If "ConversationId" is provided, it will estimate the wait time for that specific Conversation.

Input:

  • queueId: string
  • conversationId: string 
  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.EstimatedWaitTimePredictions

Example:

CODE
using DCM.GenesysHelper.Services;  
 
string queueId = ConfigurationManager.AppSettings.Get("QueueId");
string interactionId = ConfigurationManager.AppSettings.Get("InteractionId");
var result = new RoutingService().GetQueueEstimatedWaitTime(queueId, interactionId);
DCM.GenesysHelper.Services.RoutingService.UpdateConversationPriority

Description: Changes the priority value of a Conversation. The "priority" value is an integer between -25000000 and 25000000.

Input:

  • conversationId: string 
  • priority: int
  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.RoutingConversationAttributesResponse

Example:

CODE
using DCM.GenesysHelper.Services;  
 
string converastionId= ConfigurationManager.AppSettings.Get("ConversationId");
int priority = Int32.Parse(ConfigurationManager.AppSettings.Get("Pririty"));
var result = new RoutingService().UpdateConversationPriority(converastionId,  priority );

Examples

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


JavaScript errors detected

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

If this problem persists, please contact our support.