aura-mocks-genesys-api plugin

Plugin that mocks the behavior of Genesys, the call-center service used by Telefónica OBs.

Description

The aura-mocks-genesys-api plugin contains the services used by aura-bot and aura-bridge to work without real Genesys services.

These services are mainly:

Find more information in the Github repository:
https://github.com/Telefonica/aura-mocks-server/tree/master/src/plugins/aura-mocks-genesys-api

This is part of aura-mocks-server project.

Genesys API

Chat API Version 2

Genesys documentation: https://docs.genesys.com/Documentation/GMS/latest/API/ChatAPIv2

Currently, the mock for Genesys has the following endpoints implemented:

Enpoint Method Group description
/genesys/2/chat/{serviceName} POST Chat Request Chat
/genesys/2/chat/{serviceName}/{chatId}/send POST Chat Send Message
/genesys/2/chat/{serviceName}/{chatId}/disconnect POST Chat Disconnect
/genesys/2/chat/{serviceName}/{chatId}/pushUrl POST Chat PushUrl

Start a new chat

Steps

  1. Perform a POST request to /Genesys/2/Chat/{ServiceName}
  2. When a new chat is created using the POST request to “/Genesys/2/Chat/{ServiceName}”, the system uses the settings indicated in the profile parameter or uses the default profile configuration if this parameter is not informed (see Profiles mock API
  3. Send messages to chat using the endpoint /genesys/2/chat/{serviceName}/{chatId}/send

You can change at any time the value of Pushurl using the endpoint /genesys/2/chat/{serviceName}/{chatId}/pushUrl

Sessions Mock API

To help in testing tasks, the mocks exposes a series of services associated with the sessions it manages and the profiles that can be used to start a conversation.

Get session information

Sessions are identified by the chatId, so once a chat is created, you can check the session using /genesys/2/mock/sessions/{chatId}.

Endpoins

Enpoint Method Group description
/genesys/2/mock/sessions GET Session Get chat mock sessions
/genesys/2/mock/sessions/{chatId} GET Session Get session by chatId
/genesys/2/mock/sessions/stats GET Session Get session stats
/genesys/2/mock/sessions/keys GET Session Get session keys
/genesys/2/mock/sessions DELETE Session Remove session

Profiles Mock API

The profiles allow you to configure a different execution environment to the default environment, in order to receive answers in another address (Pushurl) and execute automatic actions when starting a new chat.

What are the profiles for?

When a new chat is created using the POST request /genesys/2/chat/{serviceName}, a profile is used to configure mainly two parameters:

  • pushUrl: It indicates the address where PUSH notifications will be sent.
  • autoMessages: Messages that will be executed automatically at the beginning of the conversation and using the waiting time indicated for each message.

See default profile settings

An example of configuration for the “default” profile is shown below:

// Post result to "/genesys/2/mock/profiles"
[
    {
        "profile": "default",
        "settings": {
            "chat": {
                "pushUrl": "https://svc-ap-current.auracognitive.com/aura-services/v1/genesys/messages",
                "autoMessages": [
                    {
                        "from": {
                            "nickname": "system",
                            "type": "External"
                        },
                        "type": "ParticipantJoined",
                        "timeout": 1
                    },
                    {
                        "from": {
                            "type": "External"
                        },
                        "type": "Message",
                        "timeout": 1,
                        "text": "You have approximately 15 minutes to be attended"
                    },
                    {
                        "from": {
                            "type": "External"
                        },
                        "type": "Message",
                        "timeout": 1,
                        "text": "Soon one of our agents will attend you personally"
                    },
                    {
                        "from": {
                            "nickname": "agent1",
                            "type": "Agent"
                        },
                        "type": "ParticipantJoined",
                        "timeout": 1
                    },
                    {
                        "from": {
                            "type": "Agent"
                        },
                        "type": "Message",
                        "timeout": 1,
                        "text": "Hello, I am an Agent, how can I help you?"
                    }
                ]
            }
        }
    }
]

In the default configuration, once a new chat is created, the following messages will be executed:

  • A second after starting the chat, the “system” (external) user will join conversation.
  • After that, “system” will send a message “You have approximately 15 minutes to be attended” (1 second after the previous message).
  • “system” will send a message “Soon one of our agents will attend you personally” (1 second after).
  • “agent1” (Agent) user will join conversation (1 second after).
  • “agent1” will send a message “Hello, I am an Agent, how can I help you?” (1 second after).

Endpoints

Enpoint Method Group description
/genesys/2/mock/profiles GET Profile Get profiles
/genesys/2/mock/profiles/{profile} GET Profile Get profile by name
/genesys/2/mock/profiles/default POST Profile Set profile by name
/genesys/2/mock/profiles/reset GET Profile Reset profiles
/genesys/2/mock/chat/{serviceName}/{chatId}/send POST MockChat Send message directly to the session, with optional timeout

Chat Mock API

You can send any type of event in chat using the service /genesys/2/mock/chat/{serviceName}/{chatId}/send. The format is similar to “autoMessages” for a profile.

The postman linked to this documentation contains an example of all types of events that can be sent to chat.

Postman