### startConnection Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Starts the web socket connection. ```APIDOC ## startConnection ### Description Starts the connection ### Returns void ``` -------------------------------- ### startSession Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Starts a new agent session. ```APIDOC ## startSession ### Description Starts a new agent session. ### Signature `startSession(sessionInfo: any): Promise` ### Parameters #### Request Body - **sessionInfo** (any) - Required - Information required to start the session. ``` -------------------------------- ### Starting the Leader Election Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneLeaderElector.html Call the `start` method to initiate the leader election process. This method enables the leader election mechanism across multiple browser instances. ```APIDOC ## Method: start ### Description Provides leader election mechanism for within multiple browser instances. ### Example ```typescript CXoneLeaderElector.instance.start(); ``` ### Returns void ``` -------------------------------- ### Start Leader Election Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneLeaderElector.html Call the `start` method on the `CXoneLeaderElector` instance to initiate the leader election mechanism. This should be called after obtaining the singleton instance. ```typescript CXoneLeaderElector.instance.start(); ``` -------------------------------- ### Instantiate DigitalContactService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DigitalContactService.html Example of how to create an instance of the DigitalContactService. ```javascript const digitalContactSvc = new DigitalContactService(); ``` -------------------------------- ### setUpDeviceSync Source: https://developer.niceincontact.com/Content/sdk-docs/classes/JabraSdkService.html Configures and enables synchronization between the device and the SDK. ```APIDOC ## setUpDeviceSync ### Description Set up device sync. ### Method (Method signature implies asynchronous operation, likely a Promise) ### Endpoint N/A (SDK method) ### Example ```javascript setUpDeviceSync(); ``` ### Returns Promise ``` -------------------------------- ### Start Get Next Events Polling Source: https://developer.niceincontact.com/Content/sdk-docs/classes/GetNextEventProvider.html Starts the GetNextEvents polling process for a specified agent session. If no session ID is provided, it may default to the current session. ```typescript this.startGetNextEvents(); ``` -------------------------------- ### Spawn Script Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AdminService.html Calls and starts a new script instance. Requires script ID, skill ID, parameters, and a start date. Returns an HTTP response or an error. ```typescript spawnScript(); ``` -------------------------------- ### initialize Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Initializes the user details including CXone configuration, user information, and access token. ```APIDOC ## initialize ### Description Method to initialize the user details (i.e) cxoneConfig, userInfo and aceessToken ### Signature initialize(accessToken: string, config: CXoneConfiguration, userInfo: UserInfo): void ### Parameters * **accessToken**: string - Access token * **config**: CXoneConfiguration - cxoneConfig object * **userInfo**: UserInfo - user info object ### Returns void ### Example ```javascript const agentSession = ACDSessionManager.instance.initialize(accessToken, config, userInfo); ``` ``` -------------------------------- ### Get API Request with Correlation ID Source: https://developer.niceincontact.com/Documentation/CorrelationIdGettingStarted This example demonstrates how to make a GET request to an API, including the 'Authorization' and 'x-Correlation-ID' headers. The response includes the 'X-Correlation-ID' header, which can be used for tracing. ```powershell $headers = @{} $headers["Authorization"] = "bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJ1c2VyOjExZWNiNGQ3LTVjMGUtNDQ5MC1hMTZjLTAyNDJhYzExMDAwMiIsInJvbGUiOnsibGVnYWN5SWQiOiJBZG1pbmlzdHJhdG9yIiwic2Vjb25kYXJ5Um9sZXMiOltdLCJpZCI6IjExZWJjODJkLWM1ZTItYTJlMC04MTk0LTAyNDJhYzExMDAwMiIsImxhc3RVcGRhdGVUaW1lIjoxNjY0Nzk5MTA0MjQ2fSwiaWNBZ2VudElkIjoiMjQyMTEiLCJpc3MiOiJodHRwczpcL1wvYXV0aC5kZXYubmljZS1pbmNvbnRhY3QuY29tIiwiZ2l2ZW5fbmFtZSI6IkltZGFkdWwiLCJhdWQiOiJpbnRlcm5hbEBpbmNvbnRhY3QgaW5jLiIsImljU1BJZCI6IjI3IiwiaWNCVUlkIjo0NjY5LCJuYW1lIjoiaW1kYWR1bC5zaGFyaWZAZG83Mi5jb20iLCJ0ZW5hbnRJZCI6IjExZWJjODJkLWJmZTgtNTUxMC05MGNkLTAyNDJhYzExMDAwMiIsImV4cCI6MTY2NDg2NjAzNywiaWF0IjoxNjY0ODYyNDM3LCJmYW1pbHlfbmFtZSI6IlNoYXJpZiIsInRlbmFudCI6InBlcm1fcHVuZV9hcGlfZG83MjQyMTkyMTMzIiwidmlld3MiOnt9LCJpY0NsdXN0ZXJJZCI6IkRPNzIifQ.YSFyyCc3aZ6u1IgOBQUdB7bR3ueSS2FlbGw9WDrXGgCyQrOP9Q1ZaHCJj-QVP9_A93NAz_aMiOfwYlwJzA6yiq6VmiWAEnLuxAoopz-8RCnVYG50QyjkmERwdgmx58ueZSQ_nUQS2qmGkk3O1JIKftxwqORXQWg8QxkWjQBTjsI" $headers["x-Correlation-ID"] = "29d7c6fc-5535-4cb4-83e5-90d9e0aa6d61" $headers["content-type"] = "application/json" $headers["Accept"] = "application/json" curl -V -Uri https://api-do72.dev.nice-incontact.com/InContactAPI/services/v24.0/agents/24211 -Headers $headers -Method Get ``` -------------------------------- ### constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectory.html Creates an instance for the directory session and initializes it. ```APIDOC ## constructor ### new CXoneDirectory(): CXoneDirectory * Create instance for directory session and initialize it example ``` new DirectoryBase(); ``` #### Returns CXoneDirectory ``` -------------------------------- ### Start Getting Next Events Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Initiates the process of fetching the next events for the agent session. Can optionally accept a sessionId. This method is synchronous and returns void. ```typescript const startGetNextEvents = agentSession.startGetNextEvents ``` -------------------------------- ### Get IEX Schedule for Agent Source: https://developer.niceincontact.com/Content/sdk-docs/classes/IEXService.html Retrieve all IEX Schedules for a specific agent within a date range. Requires agent ID, start date, and end date. ```typescript getIEXSchedule(1464319); ``` -------------------------------- ### initialize Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AdminService.html Initializes the AdminService with necessary credentials and configuration. ```APIDOC ## initialize ### Description Method to initialize the user details (i.e) cxoneConfig, userInfo and aceessToken. ### Method ```typescript initialize(accessToken: string, config: CXoneConfiguration, userInfo: UserInfo): void ``` ### Parameters #### Path Parameters - **accessToken** (string) - Required - Access token. - **config** (CXoneConfiguration) - Required - cxoneConfig object. - **userInfo** (UserInfo) - Required - user info object. ### Returns void ``` -------------------------------- ### Get Directories Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDynamicDirectory.html Retrieves a list of directories for a given agent. Supports pagination with optional start index and total records parameters. Use this to fetch directory data. ```typescript getDirectories(1234,0,25) ``` -------------------------------- ### CXoneBaseAdapter Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneBaseAdapter.html Initializes a new instance of the CXoneBaseAdapter class. ```APIDOC ## new CXoneBaseAdapter() ### Description Initializes a new instance of the CXoneBaseAdapter class. ### Returns CXoneBaseAdapter ``` -------------------------------- ### init Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAuth.html Initializes the authentication settings. ```APIDOC ## init ### Description Initializes the auth settings. ### Method init(authSettings: AuthSettings): void ### Parameters #### Path Parameters - **authSettings** (AuthSettings) - An object containing authentication settings. ### Request Example ```javascript init({'cxoneHostname': 'https://cxone.dev.niceincontact.com', 'clientId': 'Salesforce Agent Console@inContact Inc.'}) ``` ``` -------------------------------- ### SupervisorContact and SupervisorMonitor Event Examples Source: https://developer.niceincontact.com/Documentation/AgentSessionEvents?accordionId=CallContactEvents Events related to supervisor actions. SupervisorContact provides details about an active contact being monitored, while SupervisorMonitor indicates the start of a monitoring session. ```json { "Type": "SupervisorContact", "ContactID": "6550071587", "Status": "Active", "OriginalState": "False", "CallType": "Regular", "DNIS": "9991638000", "ANI": "+748596215382", "Skill": "50883", "IsInbound": "False", "StartTimeUTC": "2013-09-11T07:32:03.000Z", "LastStateChangeTimeUTC": "2013-09-11T07:32:04.000Z", "ScreenPopUrl": "", "DisconnectCode": "NA", "IsLogging": "False", "Timeout": "", "AllowDispositions": "False", "Label": "", "IsLinked": "False", "TimeZones": "", "FinalState": "False", "OtherInformation": "" } ``` ```json { "Type": "SupervisorMonitor", "MonitorStartTime": "2013-09-11T07:32:10.000Z", "TargetAgentId": "9011", "FinalState": "False" } ``` -------------------------------- ### startWemWebSocket Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WemNotificationProvider.html Starts the WebSocket connection for WEM notifications. ```APIDOC ## startWemWebSocket ### Description Starts the WebSocket connection for WEM notifications. ### Method POST ### Endpoint /wem/notification/ws/start ### Response #### Success Response (200) - `status` (string) - Indicates the status of the WebSocket connection. ``` -------------------------------- ### Get All Skills List with Filtering Source: https://developer.niceincontact.com/Content/sdk-docs/classes/SkillService.html Fetch a list of all available skills, with options to filter by media type, start index, number of records, search text, and force fetch. ```typescript getAllSkillsList(4,1,5,'call',false) ``` -------------------------------- ### Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDynamicDirectory.html Creates an instance for a dynamic directory session and initializes it. ```APIDOC ## new CXoneDynamicDirectory() ### Description Create instance for dynamic directory session and initialize it. ### Returns CXoneDynamicDirectory ### Example ```javascript new CXoneDynamicDirectory(); ``` ``` -------------------------------- ### Get Directory Entries Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDynamicDirectory.html Retrieves all entries for a specific directory, identified by directoryId and agentId. Supports pagination with optional start index and total records. Use this to fetch detailed directory content. ```typescript getDirectoryEntries('11eb3f87', '1124893d', 0, 25) ``` -------------------------------- ### connectServer Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneVoiceClient.html Initializes the client and establishes a connection to the WebRTC server. ```APIDOC ## connectServer ### Description Initialize this client and connect to the WebRTC server. Please use `onConnectionStatusChanged` event for both success and failure notification for server connectivity. ### Parameters * acdAgentId (string) - CXone agent number, that will be used for voice connection. * options (CXoneVoiceConnectionOptions) - CXone audio connection options that has WebRTC server information. * audioElement (HTMLAudioElement) - Audio element used to open audio stream. * appName (string) - The name of the application. ### Returns void ### Example ```typescript voiceClient.connectServer('12345', options, audioElement, 'myApp'); ``` ``` -------------------------------- ### startWemWebSocket Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WemNotificationProvider.html Starts the WebSocket connection for receiving notifications. ```APIDOC ## startWemWebSocket ### Description This method starts the WebSocket connection. ### Method startWemWebSocket(requestData: WemNotificationRequestData): void ### Parameters #### requestData: WemNotificationRequestData Locale of the system ### Returns void ``` -------------------------------- ### Get Agent Schedule - WemScheduleService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WemScheduleService.html Fetches the agent's schedule within a specified date range. Requires valid Date objects for start and end dates. Returns a Promise that resolves to either an error or the agent's schedule. ```typescript getSchedule(Tue Aug 16 2022 11:49:38 GMT+0530, Tue Aug 17 2022 11:49:38 GMT+0530) ``` -------------------------------- ### CXoneGetNextAdapter Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneGetNextAdapter.html Initializes a new instance of the CXoneGetNextAdapter class. ```APIDOC ## Constructor ### new CXoneGetNextAdapter() Initializes a new instance of the `CXoneGetNextAdapter` class. #### Returns - `CXoneGetNextAdapter`: The newly created instance. ``` -------------------------------- ### Perform a GET Request Source: https://developer.niceincontact.com/Content/sdk-docs/classes/HttpClient.html Use the get method to send a GET request to a specified URL. Optionally include a boolean to measure API latency. ```typescript get('https://nice.dev.cxone.com/getUsers', {body: 'api_request_body'}, true) ``` -------------------------------- ### Get Agent Workflow Event Subject Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Used to get the agent workflow event subject. ```typescript const _agentWorkflowEvent = agentSession.agentWorkflowEvent ``` -------------------------------- ### initializeDigital Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DigitalContactManager.html Initializes Digital methods like starting websocket and user slot connection. ```APIDOC ## initializeDigital ### Description Initialize Digital methods like starting websocket, user slot connection. ### Method initializeDigital(): Promise ### Request Example ``` initializeDigital() ``` ``` -------------------------------- ### Start Keep-Alive Polling Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Starts KeepAlivePolling for a specified agent session. An optional sessionId can be provided. ```typescript this.startKeepAlivePolling(); ``` -------------------------------- ### startConnection Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Method to start a connection with user information. This establishes the WebSocket connection for the UI queue provider. ```APIDOC ## startConnection ### Description Method to start connection. ### Method Promise ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **userInfo** (UserInfo) - Required - current logged in user information ### Request Example ```typescript startConnection(userInfo) ``` ### Response #### Success Response (Promise) Returns a Promise that resolves when the connection is established. ``` -------------------------------- ### Start Signal Script Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneIndicatorManager.html Used to start a signal script. This method initiates a signal script process. ```typescript openSignalScript(); ``` -------------------------------- ### CXonePopUrl Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXonePopUrl.html Initializes a new instance of the CXonePopUrl class. ```APIDOC ## constructor ### Description Initializes a new instance of the CXonePopUrl class. ### Method constructor ### Returns CXonePopUrl ``` -------------------------------- ### Instantiate AddressBookService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AddressBookService.html Demonstrates how to create an instance of the AddressBookService. Ensure AdminService is available. ```typescript const adminService = new AdminService(); ``` -------------------------------- ### Get Agent Workflow Request Event Subject Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Used to get the agent workflow request event subject. ```typescript const agentWorkflowRequestEvent = agentSession.agentWorkflowRequestEvent ``` -------------------------------- ### Instantiate AgentAssistWSService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AgentAssistWSService.html Creates a new instance of the AgentAssistWSService. No specific setup is required before instantiation. ```typescript new AgentAssistWSService(); ``` -------------------------------- ### Get Singleton AgentStateManager Instance Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AgentStateService.html Accesses the singleton instance of the AgentStateManager. Use this to get the shared instance of the manager. ```typescript const agentStateManaget = AgentStateManager.instance; ``` -------------------------------- ### Instantiate DigitalMessageNoteService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DigitalMessageNoteService.html Demonstrates how to create an instance of the DigitalMessageNoteService. ```javascript const digitalMessageNoteSvc = new DigitalMessageNoteService(); ``` -------------------------------- ### Start Session Request Body Source: https://developer.niceincontact.com/Documentation/UsingEvents This JSON object is sent as the request body when starting a new agent session. ```json { "stationPhoneNumber": "4005150001" } ``` -------------------------------- ### Initialize Authentication Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneUser.html Initializes authentication details using an access token and CXone configuration. Requires an instance of CXoneUser. ```javascript const user = CXoneUser.instance; user.initAuth(accessToken, cxOneConfig); ``` -------------------------------- ### Instantiate CXoneCustomScreenpop Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneCustomScreenpop.html Creates a new instance of the CXoneCustomScreenpop class. No specific setup is required before instantiation. ```javascript const cxoneCustomScreenpop = new CXoneCustomScreenpop(); ``` -------------------------------- ### CallContactEvent Example Source: https://developer.niceincontact.com/Documentation/AgentSessionEvents?accordionId=ChatContactEvents This is an example of a CallContactEvent, which can represent various call-related events, including taking over an agent's call. ```APIDOC ## CallContactEvent ### Description Represents an event related to a contact interaction, such as taking over an agent's call. ### Fields - **Type** (string) - The type of event, e.g., "CallContactEvent". - **ContactID** (string) - The unique identifier for the contact. - **Status** (string) - The current status of the contact. - **OriginalState** (string) - Indicates the original state of the contact. - **CallType** (string) - The type of call, e.g., "TakeOver". - **DNIS** (string) - Dialed Number Identification Service number. - **ANI** (string) - Automatic Number Identification number. - **Skill** (string) - The skill associated with the contact. - **IsInbound** (string) - Indicates if the call is inbound. - **StartTimeUTC** (string) - The start time of the event in UTC. - **LastStateChangeTimeUTC** (string) - The last time the state was changed in UTC. - **ScreenPopUrl** (string) - URL for screen pop. - **DisconnectCode** (string) - Code indicating why the call was disconnected. - **IsLogging** (string) - Indicates if logging is enabled. - **Timeout** (string) - Timeout value. - **AllowDispositions** (string) - Indicates if dispositions are allowed. - **Label** (string) - A label for the event. - **IsLinked** (string) - Indicates if the event is linked. - **TimeZones** (string) - Time zone information. - **FinalState** (string) - The final state of the event. - **OtherInformation** (string) - Additional information. - **BlendingToSkillName** (string) - The name of the skill being blended to. ``` -------------------------------- ### WebSocketMessage Constructor Example Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WebSocketMessage.html Demonstrates the usage of the WebSocketMessage constructor with sample data. ```typescript this.WebSocketMessage(data); ``` -------------------------------- ### Instantiate CXoneScreenPop Manager Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneScreenPop.html Demonstrates how to create an instance of the screen pop manager. ```typescript const screenPopManager = new screenPopManager(); ``` -------------------------------- ### Get Singleton Instance of PersonalConnectionService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/PersonalConnectionService.html Accesses the singleton instance of the PersonalConnectionService. Use this accessor to get the shared instance of the service. ```typescript const personalConnectionService = PersonalConnectionService.instance; ``` -------------------------------- ### Get Presence Sync URI Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneConfiguration.html Retrieves the Presence sync URL. Use this to get the endpoint for synchronizing presence information. ```typescript getPresenceSyncUri('na1','staging.niceincontact.com'); ``` -------------------------------- ### CustomerCardNote Type Example Source: https://developer.niceincontact.com/Content/sdk-docs/interfaces/CustomerCardNote.html This example shows the expected type for an array of CustomerNotes, which is relevant when working with customer card notes. ```typescript Array ``` -------------------------------- ### Get Embedded Pages WemNotificationService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WemNotificationService.html Call this method to get Embedded Pages. It returns a Promise that resolves to either a CXoneSdkError or WemEmbeddedPageLinks. ```typescript getEmbeddedPages(response) ``` -------------------------------- ### Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectoryProvider.html Creates a new instance of the CXoneDirectoryProvider. ```APIDOC ## constructor ### Description Create a directory provider. ### Returns CXoneDirectoryProvider ### Example ```typescript const provider = new CXoneDirectoryProvider(); ``` ``` -------------------------------- ### startGetNextEvents Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Starts the process for retrieving next events. An optional session ID can be provided. ```APIDOC ## startGetNextEvents ### Description Starts the process for retrieving next events. ### Signature startGetNextEvents(sessionId?: string): void ### Parameters * **Optional sessionId**: string ### Returns void ### Example ```javascript const startGetNextEvents = agentSession.startGetNextEvents ``` ``` -------------------------------- ### Get Singleton FeatureToggleService Instance Source: https://developer.niceincontact.com/Content/sdk-docs/classes/FeatureToggleService.html Access the singleton instance of FeatureToggleService. This is the recommended way to get an instance for managing feature toggles. ```typescript const ftService = FeatureToggleService.instance; ``` -------------------------------- ### Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAgentSetting.html Initializes a new instance of the CXoneAgentSetting class. It is used to get an instance for CXoneAgentSetting and adminService. ```APIDOC ## constructor ### Description Initializes a new instance of the CXoneAgentSetting class. ### Usage ```typescript const cxoneAgentSetting = new CXoneAgentSetting(); ``` ### Returns - CXoneAgentSetting: An instance of the CXoneAgentSetting class. ``` -------------------------------- ### CXoneCustomScreenpop Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneCustomScreenpop.html Initializes a new instance of the CXoneCustomScreenpop class. ```APIDOC ## new CXoneCustomScreenpop() ### Description Initializes a new instance of the CXoneCustomScreenpop class. ### Returns CXoneCustomScreenpop - A new instance of the CXoneCustomScreenpop class. ``` -------------------------------- ### Get User Hub Notification URI Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneConfiguration.html Retrieves the notification URI for the User Hub. Use this to get the endpoint for receiving notifications. ```typescript getUserHubNotificationUri('na1','staging.nice-incontact.com'); ``` -------------------------------- ### Get Favorites by Agent Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectory.html Retrieves the list of favorite contacts for a specific agent. Pass the agent's name to get their favorites. ```typescript this.getFavorites(searchText); ``` -------------------------------- ### startSession Method Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneSession.html Initiates a new agent session. This method requires details such as station ID and phone number to start the session. ```APIDOC ## Methods ### startSession * startSession(startSessionRequest: StartSessionRequest): Promise * Method to start the session #### Parameters * ##### startSessionRequest: StartSessionRequest start agent session request object ``` @example const startSessionObj: StartSessionRequest = { stationId: stationId?.current?.value || '', stationPhoneNumber: stationPhoneNo?.current?.value || '', }; const startSession = this.startSession(startSessionObj); ``` #### Returns Promise ``` -------------------------------- ### Get Team Unavailable Codes Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAcdClient.html Fetch team unavailable codes. An optional teamId can be provided to get codes for a specific team. ```typescript getTeamUnavailableCodes(); ``` -------------------------------- ### constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneVoiceClient.html Initializes a new instance of the CXoneVoiceClient class. ```APIDOC ## constructor ### Description Constructor for Voice Client ### Returns CXoneVoiceClient ### Example ```typescript voiceClient = new CXoneVoiceClient(); ``` ``` -------------------------------- ### Instantiate WSService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSService.html Creates a new instance of the WSService. No specific setup is required beyond having the class available. ```typescript new WSService(); ``` -------------------------------- ### Request Directory Data and Start Polling Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectoryProvider.html Initiates the polling for directory data. Ensure the CXoneDirectoryProvider instance is initialized and polling is started. ```typescript const directoryProvider = new CXoneDirectoryProvider(); this.directoryProvider.startPolling(); ``` -------------------------------- ### Initialize CXone SDK Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAuth.html Initializes the CXone SDK with essential authentication settings, including the CXone hostname and client ID. ```typescript init({'cxoneHostname': 'https://cxone.dev.niceincontact.com', 'clientId': 'Salesforce Agent Console@inContact Inc.'}) ``` -------------------------------- ### Start ACD Session Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Starts a new session for an agent. Requires a StartSessionRequest object. Returns a Promise resolving to an HttpResponse or CXoneSdkError. ```typescript const startAgentSession = this.startSession(startSessionRequest) ``` -------------------------------- ### Initialize Admin Service Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AdminService.html Initializes the AdminService with an access token, configuration, and user information. This is a required setup step before using other methods. ```typescript const agentSession = AdminService.instance.initialize(accessToken, config, userInfo); ``` -------------------------------- ### Get Server Timestamp Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DateTimeUtilService.html This method retrieves the current server timestamp. Call it to get a numerical representation of the server's current time. ```typescript getServerTimestamp(); ``` -------------------------------- ### CXoneAcdClient.instance() Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAcdClient.html Provides a singleton instance of the CXoneAcdClient for agent authentication and session management. ```APIDOC ## instance ### Description Provides a singleton instance of the CXoneAcdClient class for agent authentication and session management. ### Returns CXoneAcdClient ### Example ```javascript const cxoneAcdClient = CXoneAcdClient.instance(); ``` ``` -------------------------------- ### Get Singleton Instance of CXoneDigitalWebsocket Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDigitalWebsocket.html Access the singleton instance of the CXoneDigitalWebsocket class. This is the standard way to get an object to interact with the WebSocket functionality. ```typescript const cxoneDigitalWebsocket = CXoneDigitalWebsocket.instance; ``` -------------------------------- ### Get Singleton Instance of CXoneDigitalUtil Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDigitalUtil.html Accesses the singleton instance of the CXoneDigitalUtil class. Use this method to get the single, shared instance of the utility. ```typescript const cxoneDigitalUtil = CXoneDigitalUtil.instance(); ``` -------------------------------- ### Start Connection with User Info Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Method to initiate a connection, requiring UserInfo as a parameter. Returns a Promise that resolves when the connection is established. ```typescript startConnection(userInfo) ``` -------------------------------- ### Update Controls on Consult Call Started in JavaScript Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneVoiceContact.html Call this method when a consult call is started or is running to update the relevant call controls. ```javascript updateControlsOnConsultCallStarted() ``` -------------------------------- ### startNewCall Source: https://developer.niceincontact.com/Content/sdk-docs/classes/JabraSdkService.html Initiates a new outgoing call. ```APIDOC ## startNewCall ### Description Start a new call. ### Method (Method signature implies asynchronous operation, likely a Promise) ### Endpoint N/A (SDK method) ### Example ```javascript startNewCall(); ``` ### Returns Promise ``` -------------------------------- ### UIQueueWsProvider Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Initializes a new instance of the UIQueueWsProvider class, setting up the agent session. ```APIDOC ## constructor ### Description Constructor which sets agent session instance ### Returns UIQueueWsProvider ### Example ```typescript UIQueueWsProvider(); ``` ``` -------------------------------- ### WSService Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSService.html Creates an instance for the websocket service. ```APIDOC ## constructor ### Description Create instance for websocket service ### Returns WSService ### Example ``` new WSService(); ``` ``` -------------------------------- ### Get User Hub WFM URI Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneConfiguration.html Retrieves the WFM (Workforce Management) URI for the User Hub. Use this to get the endpoint for WFM-related operations. ```typescript getUserHubWfmUri('na1','nice-incontact.com'); ``` -------------------------------- ### Get Token Endpoint Source: https://developer.niceincontact.com/Documentation/YourFirstApp?Length=13 Retrieves the token endpoint URL by making a GET request to the OpenID Connect discovery endpoint. Ensure the HttpClient is properly configured. ```csharp private static void GetTokenEndpoint() { var client = new HttpClient(); var request = new HttpRequestMessage() { RequestUri = new Uri($"{DiscoveryBaseEndpoint}{OpenIdDiscoveryPath}"), Method = HttpMethod.Get, }; request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain")); var response = client.Send(request); response.EnsureSuccessStatusCode(); var jsonTask = response.Content.ReadAsStringAsync(); jsonTask.Wait(); var jsonText = jsonTask.Result; var jsonObject = JsonNode.Parse(jsonText); _tokenEndpoint = jsonObject?["token_endpoint"]?.GetValue(); } ``` -------------------------------- ### Initialize All Methods Source: https://developer.niceincontact.com/Content/sdk-docs/classes/JabraSdkService.html Initializes all available methods within the Jabra SDK Service. Returns a void promise. ```typescript initAll(); ``` -------------------------------- ### initAll Source: https://developer.niceincontact.com/Content/sdk-docs/classes/JabraSdkService.html Initializes all necessary components and services within the Jabra SDK. ```APIDOC ## initAll ### Description Initialize all the methods. ### Method (Method signature implies asynchronous operation, likely a Promise) ### Endpoint N/A (SDK method) ### Example ```javascript initAll(); ``` ### Returns Promise ``` -------------------------------- ### Get Directory Metadata Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDynamicDirectory.html Retrieves the metadata for a specific directory. Requires both the directory ID and agent ID. Use this to get information about a directory's structure or properties. ```typescript getDirectoryMetadata(5678, 1234); ``` -------------------------------- ### Supervisor Monitor Event Structure Source: https://developer.niceincontact.com/Documentation/AgentSessionEvents?accordionId=IndicatorEvents Defines a SupervisorMonitor event, indicating the start of a monitoring session by a supervisor. It includes the monitor start time and the target agent ID. ```json { "Type": "SupervisorMonitor", "MonitorStartTime": "2013-09-11T07:32:10.000Z", "TargetAgentId": "9011", "FinalState": "False" } ``` -------------------------------- ### Instantiate CXoneDynamicDirectory Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDynamicDirectory.html Creates a new instance for a dynamic directory session and initializes it. This is the primary way to start using the class. ```typescript new CXoneDynamicDirectory(); ``` -------------------------------- ### Connect to WebRTC Server Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneVoiceClient.html Initializes the client and connects to the WebRTC server. Use the `onConnectionStatusChanged` event for connection status notifications. ```typescript voiceClient.connectServer('12345', options, audioElement); ``` -------------------------------- ### Get Digital Contact Details Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DigitalContactManager.html Method used to get Digital Contact Details, publish it, and subscribe to the event hub. Provide the contact ID to retrieve specific details. ```typescript getContactDetails('1234') ``` -------------------------------- ### MCHSetting Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/MCHSetting.html Initializes a new instance of the MCHSetting class. ```APIDOC ## constructor ### Description Initializes a new instance of the MCHSetting class. ### Method constructor ### Returns MCHSetting ### Example ```typescript new MCHSetting(); ``` ``` -------------------------------- ### Start Refresh Token Check Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAuth.html Initiates a check for the refresh token. It starts a worker with a timeout based on the token's expiry time to handle token refreshes automatically. ```typescript startRefreshTokenCheck(authToken, true); ``` -------------------------------- ### Instantiate PresenceSyncService Source: https://developer.niceincontact.com/Content/sdk-docs/classes/PresenceSyncService.html Demonstrates how to create an instance of the PresenceSyncService. No specific setup is required beyond this instantiation. ```typescript const presenceSync = new PresenceSyncService(); ``` -------------------------------- ### constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/AgentAssistWSService.html Initializes a new instance of the AgentAssistWSService class. ```APIDOC ## constructor ### Description Constructor for AgentAssistWSService. ### Returns AgentAssistWSService ### Example ```typescript new AgentAssistWSService(); ``` ``` -------------------------------- ### Mapper Method Example Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneClientData.html This example demonstrates how to use the mapper method to transform CXoneClientData into a format suitable for payload transmission. Ensure that both `clientData` and `consumerUpdatedData` are properly initialized before calling this method. ```typescript mapper(clientData, consumerUpdatedData); ``` -------------------------------- ### Example Authentication Token Response Source: https://developer.niceincontact.com/Documentation/GettingStarted This is an example JSON response received after a successful authentication request to the /auth/token endpoint. It contains access and refresh tokens, along with token type and expiration information. ```json { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjp7ImxlZ2FjeUlkIjoiQWRtaW5pc3RyYXRvciIsImlkIjoiMTFlYjAzNTgtNzQwOS0zZDIwLTgyZGYtMDI0MmFjMTEwMDAyIiwibGFzdFVwZGF0ZVRpbWUiOjE2ODY4NDE0NTYwMDAsInNlY29uZGFyeVJvbGVzIjpbXX0sInZpZXdzIjp7fSwia1NlcnZpY2VJZCI6IjMwMzg3NTQzIiwia1NQU2lkIjoiODg2Iiwic3ViIjoidXNlcjoxMWVjZTNmLTBkNTctMmNkMC04YWRmLTAyNDJhYzExMDAwMiIsImlzcyI6Imh0dHBzOi8vYXV0aC5uaWNlLWluY29udGFjdC5jb20iLCJnaXZlbl9uYW1lIjoiQmVvd3VsZiIsImF1ZCI6ImNkNjJiZTYxLTZhYTQtNDE3Yi04NTE4LWQ3MzVlYTM2NmUzZUBjeG9uZSIsImljQlVJZCI6NDYwMDczOCwibmFtZSI6ImJlb3d1bGZoZXJvdEBjbGFzc2ljcy5jb20iLCJ0ZW5hbnRJZCI6IjExZWIwMzU4LTcyNGItMzk3MC05N2U1LTAyNDJhYzExMDAwMyIsImZhbWlseV9uYW1lIjoiSGVyb3QiLCJ0ZW5hbnQiOiJkb2NfdGVhbV91aF9jbGFzc2ljczkyMDgyNDI5IiwiaWNDbHVzdGVySWQiOiJCMzIiLCJpYXQiOjE2ODY5NDAwMzUsImV4cCI6MTY4Njk0MzYzNX0.WD5yXN_Nxb_haxgKhqSJzcOuz7l6ezGNIFYGuFUmzlYg4vCnLZAxppGnAwvlfRT7lKtkM85fLK2xUZ-Bec1la_5uvUGObkQFnSTglLYS-q98K4AAyFFqUW1vg9J4smaLEB9hpQu9vjCLkO0BiSFfi4QXo1AHVYJHj0teswwoDhM", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJjZDYyYmU2MS02YWE0LTQxN2ItODUxOC1kNzM1ZWEzNjZlM2VAY3hvbmUiLCJpc3MiOiJodHRwczovL2N4b25lLm5pY2VpbmNvbnRhY3QuY29tIiwiaWQiOiIxMWVjZTNmLTBkNTctMmNkMC04YWRmLTAyNDJhYzExMDAwMiIsInNlc3Npb25JZCI6IjQ0Y2JmZmMwLTA1ZjUtNDEyZS04MjhmLTFmYzQ1MGM3YWEzOSIsImlhdCI6MTY4Njk0MDAzNSwiZXhwIjoxNjg2OTQ3MjM1fQ.c9VmPHJWiBr_sBqKgrzn8dj1CKaqj-VU-LenFl3beAPs-re0Mkbfy6Cv1-VgQF8uzyiQsdua7xsrXcZ4BXXv0ojbdpbkrsp9t-ev1dBqEgatcSBYd06He1BPTvElJbeaLSMR2kpynz2eyvgh2AiKEK1VyztHKMcpZ1P0erqx8P4", "id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRlZmF1bHQifQ.eyJpY0FnZW50SWQiOiIzMDM4NzU0MyIsImljU1BJZCI6Ijg4NiIsInN1YiI6InVzZXI6MTFlY2VlM2YtMGQ1Ny0yY2QwLThhZGYtMDI0MmFjMTEwMDAyIiwiaWNEb21haW4iOiJuaWNlLWluY29udGFjdC5jb20iLCJpc3MiOiJodHRwczovL2N4b25lLm5pY2VpbmNvbnRhY3QuY29tIiwiZ2l2ZW5fbmFtZSI6IkJlb3d1bGYiLCJhdWQiOiJjZDYyYmU2MS02YWE0LTQxN2ItODUxOC1kNzM1ZWEzNjZlM2UiLCJpY0JVSWQiOjQ2MDA3MzgsInRlbmFudElkIjoiMTFlYjAzNTgtNzI0Yi0zOTcwLTk3ZTU-MDI0MmFjMTEwMDAzIiwibmFtZSI6ImJlb3d1bGZoZXJvdEBjbGFzc2ljcy5jb20iLCJmYW1pbHlfbmFtZSI6Ikhlcm90IiwidGVuYW50IjoiZG9jX3RlYW1fdWhfY2xhc3NpY3M5MjA4MjQyOSIsImljQ2x1c3RlcklkIjoiQjMyIiwidXNlcklkIjoiMTFlY2VlM2YtMGQ1Ny0yY2QwLThhZGYtMDI0MmFjMTEwMDAyIiwiYXJlYSI6Im5hMSIsImlhdCI6MTY4Njk0MDAzNSwiZXhwIjoxNjg2OTQzNjM1fQ.ZaLdWKOZt5__MnNNWw-7SAYoxzPipKsJ6xkNgpE8eZLpRd5eGWc212vTogdZ57CQa5_StmK61Zb28yUafSSIYNUAsLIe5x8MVJj5P2p2ujl6esUic7NkUq76hDg13vrGfakZqS41FM0dK2LvB9y9r5tt4oO_Q3w5KqkDiVz4zLA", "issued_token_type": "urn:ietf:params:oauth:token-type:access_token" } ``` -------------------------------- ### constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectoryAdapter.html Initializes a new instance of the CXoneDirectoryAdapter class. ```APIDOC ## constructor ### Description Initializes a new instance of the CXoneDirectoryAdapter class. ### Returns - CXoneDirectoryAdapter: A new instance of the CXoneDirectoryAdapter class. ``` -------------------------------- ### CxoneHeadsetClient.addDevice Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CxoneHeadsetClient.html Adds a headset device and obtains user consent for WebHID access. ```APIDOC ## addDevice ### Description Adds device and gets webhid consent from user. ### Signature `addDevice(): Promise` ### Example ```javascript addDevice(); ``` ### Returns `Promise` ``` -------------------------------- ### Get Assigned Digital Contact Details Source: https://developer.niceincontact.com/Content/sdk-docs/classes/DigitalContactManager.html Get assigned digital contact details based on case ID. This method retrieves contact details using the provided contact ID and event information. ```typescript getDigitalContactDetails ``` -------------------------------- ### Instantiate CXoneNotificationManager Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneNotificationManager.html Example of how to create a new instance of the CXoneNotificationManager class. This is typically done when initializing the agent application. ```typescript const notification = new CXoneNotificationManager(); ``` -------------------------------- ### Example Tenant Configuration Response Source: https://developer.niceincontact.com/Documentation/GettingStarted This JSON object is an example response from the NICE API discovery endpoint. It provides details about the tenant's area, cluster, domain, and endpoints, which are crucial for constructing the API base URL. ```json { "private": false, "area": "na1", "cluster": "B32", "domain": "niceincontact.com", "acdDomain": "nice-incontact.com", "uhDomain": "nice-incontact.com", "ui_endpoint": "https://na1.nice-incontact.com", "auth_endpoint": "https://na1.nice-incontact.com", "api_endpoint": "https://api-na1.niceincontact.com", "tenantId": "11eb0358-724b-3970-97e5-0242ac110003" } ``` -------------------------------- ### Instantiate CXoneDirectory Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDirectory.html Creates a new instance for the directory session and initializes it. This is the base constructor for the directory. ```typescript new DirectoryBase(); ``` -------------------------------- ### getConsole Method Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ConsoleLogAppender.html Gets the console object. ```APIDOC ## getConsole ### Description Gets the console object. ### Returns Console Console object. ### Example ```typescript getConsole() ``` ``` -------------------------------- ### getSessionId Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Gets the current session ID. ```APIDOC ## getSessionId ### Description Gets the current session ID. ### Signature `getSessionId(): string | null` ### Returns The current session ID or null if not available. ``` -------------------------------- ### Instantiate WSProvider Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSProvider.html Create an instance of the WSProvider class, requiring an instance of CXoneDynamicDirectory. ```typescript new WSProvider(CXoneDynamicDirectory); ``` -------------------------------- ### startKeepAlivePolling Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UIQueueWsProvider.html Starts the keep-alive polling mechanism. ```APIDOC ## startKeepAlivePolling ### Description Starts the keep-alive polling ### Returns void ``` -------------------------------- ### Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/UserLocation.html Initializes a new instance of the UserLocation class. ```APIDOC ## constructor * new UserLocation(): UserLocation * #### Returns UserLocation ``` -------------------------------- ### initialize Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ContactManager.html Initializes the ContactManager. ```APIDOC ## initialize() ### Description Initializes the ContactManager, setting up necessary services and event handlers. ### Method `initialize` ### Returns `Promise` - A promise that resolves when the initialization is complete. ``` -------------------------------- ### Initialize CXoneDigitalUtil Class Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneDigitalUtil.html Demonstrates how to instantiate the CXoneDigitalUtil class. This is typically done once to create a singleton instance. ```typescript new Class() instance ``` -------------------------------- ### startGetNextEvents Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACDSessionManager.html Starts polling for next events. ```APIDOC ## startGetNextEvents ### Description Starts polling for next events. ### Signature `startGetNextEvents(): Promise` ### Returns A promise that resolves when event polling has started. ``` -------------------------------- ### constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WebsocketClient.html Initializes a new instance of the WebsocketClient class. ```APIDOC ## constructor * new WebsocketClient(): WebsocketClient * #### Returns WebsocketClient ``` -------------------------------- ### getReconnectedMessage Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSService.html Method used to get the reconnected message. ```APIDOC ## getReconnectedMessage ### Description Method used to get reconnected message with access token ### Returns DynamicDirectoyMessage - return the websocket request ### Example ``` getReconnectedMessage(); ``` ``` -------------------------------- ### Constructor Source: https://developer.niceincontact.com/Content/sdk-docs/classes/JabraSdkService.html Initializes a new instance of the JabraSdkService class. ```APIDOC ## constructor ### Description Constructor for initialization params ### Returns JabraSdkService ``` -------------------------------- ### getErrorMessage Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSService.html Method used to get an error message. ```APIDOC ## getErrorMessage ### Description Method used to get error message with error message ### Method getErrorMessage(errorMessage: string): DynamicDirectoyMessage ### Parameters #### errorMessage: string ### Returns DynamicDirectoyMessage - return the error message ### Example ``` getErrorMessage('error message'); ``` ``` -------------------------------- ### Instantiate CXoneAcdClient Source: https://developer.niceincontact.com/Content/sdk-docs/classes/CXoneAcdClient.html Use this to create an instance of the CXoneAcdClient class for agent authentication and session management. ```typescript const cxoneAcdClient = new CXoneAcdClient(); ``` -------------------------------- ### getConnectedMessage Source: https://developer.niceincontact.com/Content/sdk-docs/classes/WSService.html Method used to get the connected message. ```APIDOC ## getConnectedMessage ### Description Method used to get connected message ### Returns DynamicDirectoyMessage - return the websocket request ### Example ``` getConnectedMessage(); ``` ``` -------------------------------- ### init Source: https://developer.niceincontact.com/Content/sdk-docs/classes/ACWebRtcService.html Initializes and connects to the audio code server. This method is essential for establishing the WebRTC connection. ```APIDOC ## init ### Description Method to init and connect to audio code server. ### Signature init(acdAgentId: string, options: CXoneVoiceConnectionOptions, audioElement: HTMLAudioElement, appName: string): void ### Parameters * **acdAgentId**: string * **options**: CXoneVoiceConnectionOptions * **audioElement**: HTMLAudioElement * **appName**: string ### Returns void ### Example ```javascript webRtcService.init("12345", options, audioElement); ``` ```