Skip to main content
Skip table of contents

User 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_findUsers

This rule finds users by email or name in Genesys users

Input Params:

  • UserValue (Required)name or email of users

Output Params:

  • ErrorCode
  • ErrorMessage
  • Users: JSON list of users.

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.UserService.GetUsers

Description: Searches Genesys Users.

Input:

  • pageSize: string( default: 100)
  • pageNumber: string (default: 1)
  • userIds: List<string> 
  • sOrder: string
  • expand: List<string>
  • state: string
  • isDebugEnabled: bool

Output:

List<PureCloudPlatform.Client.V2.Model.User>

Example:

C#
using DCM.GenesysHelper.Services;        
 
var result = new UserService().GetUsers();

DCM.GenesysHelper.Services.UserService.GetUsersByUserValue

Description: Searches Users by email or name.

Input:

  • value: string - name or email of the user
  • pageSize: string( default: 100)
  • pageNumber: string (default: 1)
  • isDebugEnabled: bool

Example:

C#
using DCM.GenesysHelper.Services;        
 
var result = new UserService().GetUsersByUserValue("AnyName");

DCM.GenesysHelper.Services.UserService.GetUser

Description: Returns exactly one Genesys User.

Input:

  • userId: string
  • isDebugEnabled: bool

Output:

  • PureCloudPlatform.Client.V2.Model.User

Example:

C#
using DCM.GenesysHelper.Services;        
 
string userId = ConfigurationManager.AppSettings.Get("UserId");
var result = new UserService().GetUser(userId);
DCM.GenesysHelper.Services.UserService.GetUserId

Description: Lightweight API to get the User ID from a User's Username (primary email address).

Input:

  • userEmail: string
  • isDebugEnabled: bool

Output:

  • string

Example:

C#
using DCM.GenesysHelper.Services;        
 
string userEmail = ConfigurationManager.AppSettings.Get("UserEmail");
var result = new UserService().GetUserId(userEmail);

Examples

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


JavaScript errors detected

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

If this problem persists, please contact our support.