Skip to content

Workspace Web Edition simulator for development

License

Notifications You must be signed in to change notification settings

GenesysPureEngage/agent-api-simulator

Repository files navigation

Agent API Simulator

Important: The Agent API Simulator is sample code you can use as a development tool and is not supported by Genesys.

Agent API Simulator is a tool you can use in your local environment to develop and experiment with Workspace Web Edition (WWE).

This tool simulates Genesys Web Services locally so you don't have to run all the real services used by WWE. The simulator can initiate interactions and event within WWE with minimal resources.

To run the Agent API Simulator, you must have access to a version of WWE with the Workspace Web Edition UI and the Genesys Authentication UI.

Note: Not all Workspace Web Edition functionality is available when using the simulator.

The following WWE functionality is currently supported:

  • Logging in to a new workspace as an example agent(s)
  • Sending an inbound/internal voice call to an agent
  • Sending an email interaction to an agent
  • Making voice calls to other agents and phone numbers
  • Attaching and modifying/updating interaction data
  • Sending individual/group voicemail notifications
  • Sending service state change notifications

The simulator also includes a management page you can use to:

  • View current agent sessions
  • View and edit current interactions and their attached data

Quick start

Dependencies

Usage

To start the project in production mode, run the commands below.

Install dependencies:

npm install

Build the front end:

npm run build

Generate TLS certificates (optional but recommended, see TLS connection):

Note: Run as administrator.

npm run gen-certs

Download the UI assets for the Workspace and Authentication UIs:

npm run import-ui-assets [{WWE url}]

Run the simulator:

npm start

Clean the ui-assets and build files:

npm run clean

Accessing Workspace Web Edition, Agent API Simulator

Once the respective components are started, you can access them as follows:

You can use these credentials to login to the Workspace UI:

  • Username: \JohnSmith
  • Password: JohnSmith

Note: A '\' has to be used as prefix for the username as this agent has no associated tenant in settings.

Configuration

See src/service/config/agent-api-simulator.json for general settings.

See the data directory for the configuration, settings, agents, agent groups, and so on, that are used when running the simulator.

Configuration files description

File Description
action-codes.yaml Reason codes
agent-groups.yaml Agent groups with their agents, and group mailbox
agents.yaml Agents and their default settings
business-attributes.yaml Media types, service types, customer segments, interaction types, disposition codes and other business attributes
interaction-queues.yaml Interaction queues
personal-favorites.yaml Personal favorites
places.yaml Places
route-points.yaml Route points
cluster-options.yaml WWE settings
statistic-profiles.yaml Statistics randomization/simulation settings
transactions.yaml Transaction settings
media/attached-data.yaml Default attached data
open-media/media-management.yaml Interactions Queues (snapshots) content
open-media/workbins.yaml Workbins content
outbound/calling-list.yaml Outbound Calling Lists
outbound/campaigns.yaml Outbound Campaigns
outbound/pull-preview.yaml Outbound Pull Preview
ucs/contact-interactions-details.yaml Contact Interactions Details
ucs/contact-interactions.yaml Contact Interactions
ucs/contacts.yaml Contacts
ucs/lucene-indexes.yaml Lucene Indexes
ucs/standard-responses-category-details.yaml Standard Responses Category Details
ucs/standard-responses-details.yaml Standard Responses Details
ucs/standard-responses-root.yaml Standard Responses Category Roots
voice/capabilities.yaml Capabilities per state of voice calls
voice/extensions.yaml Extensions part of voice calls

These files can be changed while the simulator is running.

Note: Some changes, like changing a username, may require logging out first, and other changes, like modifying settings.yaml, may require reloading the Workspace Web Edition UI.

TLS connection

Genesys recommends you access the website via HTTPs in order to use all the functionality available in Workspace through the simulator. The website also works with HTTP, but some features might not be accessible.

Development Environment

Web application

To start the web application in development mode:

npm run serve:webapp

You can access the web application from http://localhost:8080

Note: Don't forget to also start the simulator service.

Service changes

The service restarts automatically when a change is detected, but you might need to refresh the webapp to ensure all changes are applied.

External web-content security

The Agent API Simulator exposes WWE on HTTP port 7777, and is configured to display external web contents exposed by a second HTTP server on port 8080 (like SCAPI webpage).

To improve security, you may want to activate those two options :

  • X-Frame-Options (for IE11)

    The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in an <iframe>. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

  • Content Security Policy (For Chrome, Firefox, Edge)

    Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks.

If necessary, you can setup X-Frame-Option and CSP headers for this server, by uncommenting the lines bellow CSP - X-Frame-Options in file ./src/samples/server.js

Testing

To run unit tests, do the following:

npm run test

This runs every .js files in the __tests__ folder.

Compatibility table

AgentApiSimulator version WWE version AuthUi version
1.0.1 9.0.000.65.7169 9.0.000.28.174
1.0.2 9.0.000.70.7976 9.0.000.30.186
1.0.3 9.0.000.69.7930 9.0.000.30.186
1.0.4 9.0.000.69.7930 9.0.000.28.174
1.0.5 9.0.000.72.8716 9.0.000.30.186

This table is updated automatically from the compatibility-versions.json file.

GitHub actions status

Node.js CI

Compatibility - Update README

Compatibility - Merge pull request

Questions

For questions and support please use Genesys DevFoundry with the tag agent-api-simulator.

License