The ININ.Addins.IC
namespace provides APIs for communicating with Interaction Center without
consuming an additional ICWS session or requiring the ICWS feature license. Some of these features include:
- Retrieving and observing changes to the
current session state
for the application. - Working with
interactions
andqueues
. - Communicating with handlers by
sending notifications
andwatching for notifications
.
If the Interaction Center server is licensed with the ICWS feature license, an add-in can
request
an ICWS baseAuthConnectionRequestSettings
object
for creating another connection to the server to allow for further customization.
Members
sessionInfo :ININ.Addins.IC.ISessionInfo
Represents the the current state of the application's session to Interaction Center.
Example
// Determine whether the application is connected
if (!ININ.Addins.IC.sessionInfo.connected) {
console.log("Application is not connected");
}
// Observe when the application is connected
ININ.Addins.IC.sessionInfo.on("connected", function(sessionInfo) {
console.log(sessionInfo.userId + " is connected to " + sessionInfo.icServer);
});
stationTypes :String
An enumeration of the different types of stations.
Properties:
Name | Value | Description |
---|---|---|
none |
"None"
|
The string representing a stationless station type. |
workstation |
"Workstation"
|
The string representing a workstation station type. |
remoteWorkstation |
"RemoteWorkstation"
|
The string representing a remote workstation station type. |
remoteNumber |
"RemoteNumber"
|
The string representing a remote number station type. |
Methods
getIcwsBaseUrl([host]) :string
Calculates the base URL for communicating with the specified Session Manager host via ICWS.
The application must be connected to Interaction Center. Callers can verify the connection by inspecting
the ININ.Addins.IC.sessionInfo
object.
The URL can be used in conjunction with the ICWS JavaScript Library to set the base URL via _util.setBaseUrl
.
Parameters
Name | Type | Description |
---|---|---|
host | string |
The Session Manager host. If not supplied, the URL to the connected host is returned. |
Returns
The URL that can be used to communicate with the specified Session Manager host.
- Type
- string
requestIcwsConnectionRequestSettings([additionalProperties]) :IPromise
Requests an ICWS baseAuthConnectionRequestSettings
object for connecting to ICWS via POST /icws/connection
.
The application must be connected to Interaction Center. Callers can verify the connection by inspecting
the ININ.Addins.IC.sessionInfo
object.
The resulting baseAuthConnectionRequestSettings
should be used immediately as it could expire and is not a guarantee to successfully establishing a connection via ICWS.
The Interaction Center server must be licensed for the ICWS SDK license or the caller must supply Interactive Intelligence MarketPlace licensing information.
Please note: Creating additional connections to Interaction Center causes additional load which may degrade system performance and reliability.
For additional details, refer to the ICWS SDK documentation library.
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
additionalProperties | Object |
Additional properties to append to the request settings. Properties
|
Returns
An IPromise
to the connection request settings.
- Type
- IPromise
sendHandlerNotification(handlerNotification) :IPromise
Sends a notification to one or more custom handlers that are watching for the objectId
and eventId
pair on their initiator.
Due to the nature of custom handlers, the server does not provide any guarantee that the notification is handled or results in any side-effects.
The application must be connected to Interaction Center. Callers can verify the connection by inspecting
the ININ.Addins.IC.sessionInfo
object.
Parameters
Name | Type | Description |
---|---|---|
handlerNotification | ININ.Addins.IC.IHandlerNotification |
The handler notification to send to the server. |
Returns
An IPromise
to the server accepting the handler notification request.
- Type
- IPromise
Example
// There must be a handler setup with an initiator with the specified `objectId` and `eventId` pair.
ININ.Addins.IC.sendHandlerNotification({
objectId: "addinHandler",
eventId: "sayHello",
data: ["world"]
});
Classes
- HandlerSentNotifications
Represents a subscription to handler-sent notifications.
Interfaces
- IHandlerNotification
Represents a notification that is sent to or received from one or more handlers.
An add-in can send notifications to one or more handlers via
ININ.Addins.IC.sendHandlerNotification
.- IHandlerNotificationHeader
Represents a pair of the object identifier and event identifier.
- IHandlerSentNotificationsSubscriptionRequest
Represents request to subscribe to the handler-sent notifications.
- ISessionInfo
Represents the state of the application's session to Interaction Center.
- IStationInfo
Represents the details about the user's logged in station.
- ISubscription
Represents a subscription.
As a best practice, events should be bound by using
on
oronce
before callingsubscribe
. There may be events that fire before theIPromise
returned fromsubscribe
is resolved.
Namespaces
- ININ.Addins.IC.Interactions
- The
ININ.Addins.IC.Interactions
namespace provides APIs for working with interactions. - ININ.Addins.IC.Queues
- The
ININ.Addins.IC.Queues
namespace provides APIs for working with queues.