Learn about the Interaction namespace methods and type definitions in the Service Client API.
Important
Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.
Methods
The Interaction namespace includes the following methods:
completeConference
Signature
|
<static> completeConference(consultInteractionId, succeeded, failed)
|
Description
|
Completes a conference.
|
Parameters
|
Name
|
Type
|
Description
|
consultInteractionId
|
string
|
The unique identifier for the consultation interaction.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
completeTransfer
Signature
|
<static> completeTransfer(consultInteractionId, succeeded, failed)
|
Description
|
Completes a transfer.
|
Parameters
|
Name
|
Type
|
Description
|
consultInteractionId
|
string
|
The unique identifier for the consultation interaction.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
consult
Signature
|
<static> consult(interactionId, targetQuery, userData, extensions, succeeded, failed)
|
Description
|
Make a consultation interaction.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
targetQuery
|
object or string
|
The destination target object, or a character string (for example, phone number).
- If targetQuery is a character string, the Service Client API creates the operation that uses a target of type CustomContact with a destination set to this value.
- If targetQuery is a JSON object, specify the following sub-parameters:
- target (string): The target type. The possible values are: "AGENT", "AGENT_GROUP", "SKILL", "INTERACTION_QUEUE", "ROUTING_POINT", and "CUSTOM_CONTACT".
- destination (string): The destination. The supported values are: the employeeId of an agent, the name of an AgentGroup, the name of a Skill, the name of an InteractionQueue, the name of a RoutingPoint, and a phone number for CustomContact.
- [media] (string): An optional media used to make the consultation. If not specified, uses the same media as the specified interaction. For example, if the interaction has a "chat" media, and you want to make a voice consultation, you must specify "voice" here.
|
userData
|
object
|
The attached user data key/value object. Set an undefined or empty JSON object if you don't want to set any user data.
|
extensions
|
object
|
The extensions key/value object. Set an undefined or empty JSON object if you don't want to set any extensions. This is not applicable for the chat media.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
deleteUserData
Signature
|
<static> deleteUserData(interactionId, key, succeeded, failed)
|
Description
|
Deletes the user data attached to the interaction. The List of User Data Write Allowed setting in Agent Setup or the service-client-api.user-data.write-allowed configuration option might restrict the allowed key/value pairs.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
key
|
string
|
The key to delete from the attached data.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
getByInteractionId
Signature
|
<static> getByInteractionId(interactionId, succeeded, failed) → {interaction.Interaction}
|
Description
|
Gets an interaction by its unique identifier.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
Returns
|
interaction.Interaction or null if the interaction doesn't exist.
|
getInteractions
Signature
|
<static> getInteractions(succeeded, failed) → {Array.<interaction.Interaction>}
|
Description
|
Gets all the interactions.
|
Parameters
|
Name
|
Type
|
Description
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
Returns
|
Array.<interaction.Interaction>
|
selectCaseByCaseId
Signature
|
<static> genesys.wwe.service.interaction.selectCaseByCaseId(caseId, succeeded, failed)
|
Description
|
Select the case in the UI by case identifier. If you subscribe to the "interaction" events (genesys.wwe.service.subscribe([ "interaction" ], eventHandler, this);), you will receive the following event:
Received interaction event: {
"event": "interaction",
"data": {
"eventType": "CASE_COLLAPSED",
"selectedCaseId": "4401820b-c4e6-4994-69c2-6ae7fdbc4905"
},
"userAgent": "WWE Server",
"protocolVersion": 2
}
Received interaction event: {
"event": "interaction",
"data": {
"eventType": "CASE_EXPANDED",
"selectedCaseId": "4401820b-c4e6-4994-69c2-6ae7fdbc4905"
},
"userAgent": "WWE Server",
"protocolVersion": 2
}
Received interaction event: {
"event": "interaction",
"data": {
"eventType": "CASE_SELECTED",
"selectedCaseId": "d4187b87-9fe1-4db8-0515-6a91e666e22d"
},
"userAgent": "WWE Server",
"protocolVersion": 2
}
|
Parameters
|
Name
|
Type
|
Description
|
caseId
|
string
|
The unique identifier for the case.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
setUserData
Signature
|
<static> setUserData(interactionId, keyValues, succeeded, failed)
|
Description
|
Sets the user data on the live interaction (for voice, this means the interaction is not in the IDLE state). This request overwrites any existing keys on the user data. The List of User Data Write Allowed setting in Agent Setup or the service-client-api.user-data.write-allowed configuration option might restrict the allowed key/value pairs.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
keyValues
|
object
|
The key value pairs to set on the user data.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
markdone
Signature
|
<static> markdone(interactionId, succeeded, failed)
|
Description
|
Mark done the selected interaction.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
Outbound interactions
The markdone operation can be used for outbound interactions such as pull preview, push preview, and direct push preview, but there are some details you need to know:
- Pull preview - Mark done is similar to doing a 'Done and Stop' action, where the next preview record is not fetched.
- Push preview - No special behaviour.
- Direct push preview - Mark done is similar to doing a 'Done and Stop' action, where it triggers a notification to Outbound Contact Server to stop sending direct push preview records.
blockMarkdone
Signature
|
<static> blockMarkdone(interactionId, warningMessage, succeeded, failed)
|
Description
|
Block the mark done operation on the selected interaction. The "markdone" event must be subscribed to receive the event which informs that there is a delay in blocking the markdone operation with this method.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique interaction identifier of the interaction to prevent the mark done operation.
|
warningMessage
|
string
|
The warning message.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
singleStepConference
Signature
|
<static> singleStepConference(interactionId, targetQuery, userData, extensions, succeeded, failed)
|
Description
|
Make a single step conference.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
targetQuery
|
object or string
|
The destination target object, or a character string (for example, phone number).
- If targetQuery is a character string, the Service Client API creates the operation that uses a target of type CustomContact with a destination set to this value.
- If targetQuery is a JSON object, specify the following sub-parameters:
- type (string): The target type. The possible values are: "AGENT", "AGENT_GROUP", "SKILL", "INTERACTION_QUEUE", "ROUTING_POINT", and "CUSTOM_CONTACT".
- destination (string): The destination. The supported values are: the employeeId of an agent, the name of an AgentGroup, the name of a Skill, the name of an InteractionQueue, the name of a RoutingPoint, and a phone number for CustomContact.
|
userData
|
object
|
The attached user data key/value object. Set an undefined or empty JSON object if you don't want to set any user data.
|
extensions
|
object
|
The extensions key/value object. Set an undefined or empty JSON object if you don't want to set any extensions. This is not applicable for the chat media.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
singleStepTransfer
Signature
|
<static> singleStepTransfer(interactionId, targetQuery, userData, extensions, succeeded, failed)
|
Description
|
Make a single step transfer.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction.
|
targetQuery
|
object or string
|
The destination target object, or a character string (for example, phone number).
- If targetQuery is a character string, the Service Client API creates the operation that uses a target of type CustomContact with a destination set to this value.
- If targetQuery is a JSON object, specify the following sub parameters:
- type (string): The target type. The possible values are: "AGENT", "AGENT_GROUP", "SKILL", "INTERACTION_QUEUE", "ROUTING_POINT", and "CUSTOM_CONTACT".
- destination (string): The destination. The supported values are: the employeeId of an Agent, the name of an AgentGroup, the name of a Skill, the name of an InteractionQueue, the name of a RoutingPoint, and a phone number for CustomContact.
|
userData
|
object
|
The attached user data key/value object. Set an undefined or empty JSON object if you don't want to set any user data.
|
extensions
|
object
|
The extensions key/value object. Set an undefined or empty JSON object if you don't want to set any extensions.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
unblockMarkdone
Signature
|
<static> unblockMarkdone(interactionId, succeeded, failed)
|
Description
|
Unblock the mark done operation on the selected interaction that was previously blocked.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique interaction identifier of the interaction to prevent the mark done operation.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
accept
Signature
|
<static> accept(interactionId, succeeded, failed)
|
Description
|
Accept an interaction when it is ringing in Agent Workspace.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique interaction identifier of the interaction to be accepted.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
reject
Signature
|
<static> reject(interactionId, succeeded, failed)
|
Description
|
Reject an interaction when it is ringing in Agent Workspace.
|
Parameters
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique interaction identifier of the interaction to be rejected.
|
succeeded
|
function
|
A function called when the operation succeeds.
|
failed
|
function
|
A function called when the operation fails.
|
|
Type definitions
The Interaction namespace includes the following object types:
Interaction
Description
|
Represents the JSON structure of an interaction. Attributes specific to voice interactions are: callUuid, direction, callType, ani, dnis and recordingState.
|
Type
|
Object
|
Properties
|
Name
|
Type
|
Description
|
interactionId
|
string
|
The unique identifier for the interaction. Note: This is a client-side ID that is lost on the next session or refresh.
|
parentInteractionId
|
string
|
The unique identifier for the parent interaction. Note: This is a client-side ID that is lost on the next session or refresh.
|
caseId
|
string
|
This identifier targets the case that this interaction is part of.
|
userData
|
object
|
The attached user data key/value object that is updated with each interaction event.
|
state
|
string
|
The current state of the interaction. Possible values are:
- UNKNOWN — An unknown state.
- IDLE — Specifies a non-active interaction which could be closed.
- RINGING — The inbound call is ringing.
- DIALING — The outbound call is ringing.
- TALKING — The call is established.
- HELD — The call is on hold.
- PREVIEW — The interaction is a call preview.
- INVITED — The open media interaction is inviting.
- ACCEPTED — The open media interaction is accepted.
- CREATED — The open media interaction has been created.
- PULLED — The open media interaction has been pulled from a workbin.
- REVOKED — The open media interaction has been revoked.
- COMPLETED — The open media interaction has been completed (Mark as done).
- ERROR — The open media interaction has an error.
- SAVED — The open media interaction has been saved.
- TRANSFERRING — The open media interaction is being transferred.
- TRANSFER_COMPLETED — The open media interaction has been transferred and the transfer has been completed.
- INVITED_CONFERENCE — The open media interaction receives a conference invitation.
- LEFT_CONFERENCE — The open media interaction has left the conference.
- USER_DATA_ATTACHED — Data has been attached to the interaction.
- USER_DATA_UPDATED — The attached data has changed in the interaction.
- JOIN_PENDING — Trying to join the chat session.
- JOIN_FAILED — The connection with the chat server failed.
- HISTORY_IN_PROGRESS — Loading the content of the chat interaction.
- HISTORY_DONE — The content of the chat interaction has been loaded.
- CANCELLED — The outbound email is cancelled.
- SENT — The outbound email is sent.
- READY — The call preview is ready.
- CANCELED — The call preview is cancelled.
- REJECTED — The call preview is rejected.
|
previousState
|
string
|
The previous state of the interaction.
|
parties
|
Array.<interaction.Party>
|
A collection of all the parties involved in the interaction.
|
isConsultation
|
boolean
|
This property is true if the interaction is a consultation; otherwise, it's false.
|
isMainCaseInteraction
|
boolean
|
This property is true if the interaction is the main interaction in the customer case; otherwise, it's false. In Workspace Web Edition, the main interaction is related to Case Information, Disposition, Note, Contact Profile, and so on.
|
callUuid
|
string
|
The UUID of the call. This attribute is only on voice interactions.
|
direction
|
string
|
The call direction. Possible values are: IN, OUT or UNKNOWN. This attribute is only on voice interactions.
|
callType
|
string
|
The call type. Possible values are: INTERNAL, INBOUND, OUTBOUND, CONSULT or UNKNOWN. This attribute is only on voice interactions.
|
ani
|
string
|
The Automatic Number Identification service. This attribute is only on voice interactions.
|
dnis
|
string
|
The Dialed Number Identification Service. This attribute is only on voice interactions.
|
recordingState
|
string
|
The call recording state. Possible values are: STOPPED, RECORDING or PAUSED. This attribute is only on voice interactions.
|
isCaseSelected
|
boolean
|
Is true if the case containing this interaction is selected, otherwise is false.
|
ronaCallState
|
string
|
This value is populated on event RELEASED when an agent receives an inbound call and does not answer. Possible values are: REDIRECTED or NO_ANSWER.
|
isCaseExpanded
|
boolean
|
Is true if the case containing this interaction is expanded, otherwise is false.
|
interactionUUID
|
string
|
The attr_itx_id for a multimedia interaction or the callUuid for a voice interaction.
|
connId
|
string
|
The unique connection ID from the T-Server.
|
contact
|
interaction.Contact
|
An object representing the contact's information.
|
|
Party
Description
|
Represents the JSON structure of a party.
|
Type
|
Object
|
Properties
|
Name
|
Type
|
Description
|
name
|
string
|
The name of the party.
|
|
Contact
Description
|
Represents the JSON structure of a contact.
|
Type
|
Object
|
Properties
|
Name
|
Type
|
Description
|
displayName
|
string
|
The contact's display name.
|
firstNname
|
string
|
The contact's first name.
|
lastName
|
string
|
The contact's last name.
|
|