Skip to main content
Version: 2.8

API Reference

Events

onAgentStateChange

This event is raised when the state of an agent for a specific channel changes.

FieldDescription
eventEvent name "agentStateChange"
versionAPI version
requestIdIdentifier to match this event to a request
channelTypeChannel type (Voice, Mail, Chat, Task, Federation)
channelIdChannel identifier (voice_<peripheral_id>)
For CCX: voice_-1
For WxCC: telephony
newStateNew state (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
newReasonCodeNew reason code. Negative values indicate no code available.
newReasonCodeLabelNew reason name
newStateChangeTimeNew state change time
oldStatePrevious state: (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
oldReasonCodePreviously selected reason code. Negative values indicate no code available.
oldReasonCodeLabelPreviously selected reason name
oldStateChangeTimePrevious change state time

Sample code for custom integrations

cil.onAgentStateChange((data) => {
console.warn(`message: onAgentStateChange, data: ${JSON.stringify(data)}`);
});

onCallVariableChanged

This event is raised when a call variable (e.g. callVariable1, user.eccVar, wrapUpReason) is changed.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onCallVariableChanged((data) => {
console.warn(`message: onCallVariableChanged, data: ${JSON.stringify(data)}`);
});

onCreateChannel

This event is raised when a new channel is created in b+s Connects.

Please see create channel event reference for available data and format.

Sample code for custom integrations

cil.onChannelCreate((data) => {
console.warn(`message: onCreateChannel, data: ${JSON.stringify(data)}`);
});

onError

This event is raised when an Integration API request fails or an error is encountered in b+s Connects.

FieldDescription
eventEvent name "error"
versionAPI version
requestIdIdentifier of the request that might have caused the error, empty if the source of the error cannot be detected.
messageShort message describing the encountered error

Sample code for custom integrations

cil.onError((error) => {
console.warn(`message: onError data: ${JSON.stringify(error)}`);
});

onQueueDataUpdate

info

This event is not available in CCX environments.

This event is raised when the queue data is updated.

QueueDataUpdate events are only fired when the agent is logged in, altough registering callback functions to subscribe on queueDataUpdates is possible before login.

FieldDescription
eventEvent name "queueDataUpdate"
versionAPI version
dataStateThe state describing the received event data. See dataState reference for more information.
queueDataArray containing the queues for which the event was fired. Depending on the dataState the array contains no, one or multiple elements. See queueData reference for more information about available data.

Depending on the dataState the array contains no, one or multiple queues.

  • When dataState is ENABLED the array contains all the queues that are currently available. This can be any number of queues.
  • When dataState is ADDED the array only contains the queue for which the subscription was added.
  • When dataState is UPDATED the array contains the updated queue.
  • When dataState is DELETED the array contains only one item with only the id property.
  • When dataState is DISABLED the array is empty.
info

If a hidden and a visible integration are active at the same time, the hidden integration will also receive an event with ENABLED each time the visible integration is registered for queue updates.

Sample code for custom integrations

cil.onQueueDataUpdate((data) => {
console.warn(`message: onQueueDataUpdate, data: ${JSON.stringify(data)}`);
});

onTeamDataUpdate

This is a real time statistic event. It is fired when an agent in the current agent's team changes their state.

These events are only fired when the current agent is logged in to voice channel. If registering the callback function here before the agent is logged in, events will appear as soon as the agent logs in.

The first event (with dataState = ENABLED) contains a list of all agents in the team.

The following events (with dataState = UPDATED) contain the data of one single updated agent.

As soon as the agent logs out, an event with an empty list, (with dataState = DISABLED), will appear.

When the agent later logs in again, the event sequence described above starts again.

Event Attributes

FieldDescription
eventEvent name "teamDataUpdate"
versionAPI version
teamDataStateThe state describing the received event data. See teamDataState reference for more information.
teamDataIf the data state is ENABLED, the object contains a list of all agents in the team. If the data state is UPDATED, the object contains only the data updated from the agent logged in. If the data state is DISABLED, the array is empty. See Team Data Structure for more information.

Sample code for custom integrations

cil.onTeamDataUpdate((data) => {
console.warn(`message: onTeamDataUpdate, data: ${JSON.stringify(data)}`);
});

onWorkitemConnect

This event is raised when a work item is accepted.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemConnect((data) => {
console.warn(`message: onWorkitemConnect, data: ${JSON.stringify(data)}`);
});
info

If auto-accept is enabled, the field activity is empty for this event.

onWorkitemCreate

This event is raised when a new work item (e.g. phone call) appears in b+s Connects and is alerting. WorkitemCreate is also dispatched, when the agent logs in while a call is on the phone (call recovery).

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemCreate((data) => {
console.warn(`message: onWorkitemCreate, data: ${JSON.stringify(data)}`);
});
info

The field activity is empty for this event.

onWorkitemEnd

This event is raised when a work item disappears from b+s Connects. If Wrap-Up is enabled, this event is sent when Wrap-Up for the item ends. If Wrap-Up is not enabled, the event is sent immediately after hang-up/end.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemEnd((data) => {
console.warn(`message: onWorkitemEnd, data: ${JSON.stringify(data)}`);
});

onWorkitemPause

This event is raised when a work item is paused (e.g a call is put on hold).

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemPause((data) => {
console.warn(`message: onWorkitemPause, data: ${JSON.stringify(data)}`);
});

onWorkitemResume

This event is raised when a paused work item is resumed.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemResume((data) => {
console.warn(`message: onWorkitemResume, data: ${JSON.stringify(data)}`);
});

onWorkitemWrapup

This event is raised when a work item changes the state to Wrap-Up.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWorkitemWrapup((data) => {
console.warn(`message: onWorkitemWrapup, data: ${JSON.stringify(data)}`);
});

onWrapupDataChanged

This event is raised when the Wrap-Up reason is changed.

Please see workitem reference for available data and format.

Sample code for custom integrations

cil.onWrapupDataChanged((data) => {
console.warn(`message: onWrapupDataChanged, data: ${JSON.stringify(data)}`);
});

Requests

dialOrConsult

This request initiates a new call. A consultation call is created when the agent already has a call.

FieldDescription
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
Make sure the channel is uniquely identified by this id.
addressDestination address
requestIdIdentifier to map an event/error to the request (optional)

Return Value

Returns a promise which has no value.
If successful, an "onWorkitemCreate" event will be raised.
If the request fails, an “error” event will be dispatched.

Sample code for custom integrations

await cil.dialOrConsult('voice', phonenumber, requestId);

getChannel

This request returns information about the specified channel.

FieldDescription
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel,
Make sure the channel is uniquely identified by this id.

Return Value

Returns a promise which resolves to a getChannel object.
Please see getChannel reference for available data and format.

Sample code for custom integrations

const result = await cil.getChannel('voice');

getReasonCodeList

This action can be called to retrieve a list of reason codes for a specified reasonType.

FieldDescription
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
Make sure the channel is uniquely identified by this id.
reasonTypeLogout, NotReady or Wrapup.

Return Value

Returns a promise which resolves to an array of reason code objects.
Please see getReasonCodeList reference for a single object's format.

Sample code for custom integrations

const result = await cil.getReasonCodeList('voice', 'Logout');

isUpdateWorkitemDataEnabled

This request returns whether the data of a workitem (call) can be updated or not.

FieldDescription
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
Make sure the channel is uniquely identified by this id.
workitemIdId of the workitem whose data is to be updated.

Return Value

Returns a promise which resolves to true if workitem data can be updated and false otherwise.

Sample code for custom integrations

const result = await cil.isUpdateWorkitemDataEnabled('voice', workitemId);

setAgentState

This request sets the state of the agent on a specific channel.

FieldDescription
requestRequest name "setAgentState"
channelIdvoice for all voice channels (multiple matching channels possible),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
stateRequested state (Ready, NotReady, Logout)
reasonCodeNot ready or logout reason code (empty if no reason code is required)
requestIdIdentifier to map an event/error to the request (optional)

Return Value

Returns a promise which has no value.
If successful, an "agentStateChange" event will be raised.
If the request fails, an “error” event will be dispatched.

Sample code for custom integrations

await cil.setAgentState(channelId, newState, reasonCode, requestId);

setWrapupReason

This request updates the Wrap-Up reason of a call.

info

When a custom Wrap-Up reason is set using the Integration API, the new value is automatically added as selected to the list of available Wrap-Up reasons in the gadget. When a different reason is manually selected from the list or set via the Integration API, the previously custom set reason is removed from the list.

FieldDescription
requestRequest name "setWrapupReason"
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
Make sure the channel is uniquely identified by this id.
workitemIdId of the workitem to update the Wrap-Up reason of.
wrapUpReasonThe name of the Wrap-Up reason to be set.
requestIdIdentifier to map an event/error to the request (optional)

Return Value

Returns a promise which has no value.
If the request fails, an “error” event will be dispatched.

Sample code for custom integrations

await cil.setWrapupReason(channelId, workitemId, 'Documentation', requestId);

updateWorkitemData

This request updates the call variables and Wrap-Up reason of a call.

caution

Overwriting the configured share record variable can lead to incorrect behavior of the b+s Connects.

info

When a custom Wrap-Up reason is set using the Integration API, the new value is automatically added as selected to the list of available Wrap-Up reasons in the gadget. When a different reason is manually selected from the list or set via the Integration API, the previously custom set reason is removed from the list.

FieldDescription
requestRequest name "updateWorkitemData"
channelIdvoice for the voice channel (without having to provide the peripheral ID),
voice_<peripheral_id> for a specific voice channel,
voice_-1 for CCX voice channel,
telephony for WxCC voice channel.
Make sure the channel is uniquely identified by this id.
workitemIdId of the workitem whose data is to be updated.
updatedDataAn object containing the data that is to be updated.
Values have to be of type string.
Example: {'callVariable1': '12345', 'user.eccVar1': '999999', 'wrapUpReason': 'Documentation'}
requestIdIdentifier to map an event/error to the request (optional)

Return Value

Returns a promise which has no value.
If the request fails, an “error” event will be dispatched.

Sample code for custom integrations

await cil.updateWorkitemData(channelId, workitemId, {'callVariable1': '12345', 'user.eccVar1': '999999', 'wrapUpReason': 'Documentation'}, requestId);

Data reference

Workitem

Work item events have a field called data, which contains a JSON structure with the following information available:

FieldDescription
eventName of the event
versionAPI version
requestIdIdentifier to match this event to a request (for future use)
activityObject containing the phone call record details. See Activity record reference.
agentIdAgent id
aniWhen there is only one participant and the direction is outgoing, toAddress is picked otherwise fromAddress is chosen.
associatedParticipantThe assigned record of the participant lookup. See CRM record reference
associationsList of all records that are assigned to the workitem (currently this list only contains the phone call record). See CRM record reference
capabilitiesList of actions that can be carried out
channelIdChannel identifier (voice_<peripheral_id>)
For CCX: voice_-1
For WxCC: telephony
channelTypeChannel type (Voice, Mail, Chat, Task, Federation).
classificationWork item class (Customer, Consultation, Conference, Transfer, Internal, Unknown).
connectedAtDate and time in UTC when the call was established (e.g 2020-07-28T09:51:17.696Z)
ctiDataPlease see the ctiData reference for available data and format.
directionIncoming or Outgoing
idCall id or Task id for the current work item
participantsList of participants with their address
participantLookupResultList of the found participant lookup entries. See CRM record reference
stateCurrent State (Unknown, Initiated, Offered, Active, Paused, Wrapup, Ended, EndedAbandoned, EndedTransferred, EndedUnknown)

ctiData

Availability of the following fields is dependent on the Finesse version, please see the Finesse documentation for more details.

PropertyDescription
callKeyCallIdIndicates the unique number for the call routed on that particular day (CCE only)
callKeyPrefixIndicates the day when the call was routed (CCE only)
callTypeType of the call
callVariable1-10Peripheral variables 1 to 10
dialedNumberDialed Number of the call
DNISDNIS of the call
mediaIdMedia routing id
outboundClassificationOutbound call classification (VOICE, FAX, ANS_MACHINE, INVALID, DO_NOT_CALL, or BUSY)
queueNameName of the queue
queueNumberQueue name id
user.<variable>ECC variables
wrapUpReasonCurrently set call Wrap-Up reason

Activity record

The activity field contains information about the created phonecall record.

info

It is possible that the activity is undefined for the workitemCreate event.

FieldTypeDescription
idStringUnique identifier of the phonecall record
recordTypeStringType of the activity record, which is phonecall

CRM record

info

It is possible that the field associatedParticipant is undefined.

CRM records consist of the following fields.

FieldTypeDescription
idStringUnique identifier of the CRM record
nameStringThe name / subject of the record
recordTypeStringCRM table name of the record (e.g. contact)

getChannel

PropertyDescription
activeDeviceIdActive device id for agents using shared line feature
channelPlease see the channel reference for available data and format.
extensionThe extension the agent is working with
firstNameFirst name of the agent
agentIdIdentifier of the agent
lastNameLast name of the agent
loginNameLogin name of the agent
teamIdThe identifier of the team the user belongs to

Channel

PropertyDescription
idUnique Identifier for the channel
typeChannel type (Voice, Mail, Chat, Task, Federation)
stateChannel/agent state (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
reasonCodeSelected reason code; negative values indicate no code available
reasonCodeLabelThe descriptive reason name
stateChangeTimePrevious change state time
workitemsList of workitems; please see workitem reference

Channel (Create Event)

PropertyDescription
idUnique Identifier for the channel
typeChannel type (Voice, Mail, Chat, Task, Federation)
previousStatePrevious channel/agent state (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
activeStateActive channel/agent state (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
nextStateNext channel/agent state (Logout, Offline, Ready, NotReady, Active, Wrapup, Unknown)
lastStateChangeDate of the last State change
stateChangeInProgressIndicates if a state change is currently pending

getReasonCodeList

PropertyDescription
labelThe descriptive reason name
idUnique Identifier for the reason

dataState

ValueDescription
ENABLEDThe agent is logged in and queueDataUpdate events can be received.
ADDEDA new subscription for a queue was created.
UPDATEDThe data of a queue has been updated.
DELETEDThe agent has been removed from a queue and the subscription to that queue was deleted.
DISABLEDqueueDataUpdate events currently can't be received because the agent is logged out.

teamDataState

ValueDescription
ENABLEDThe agent is logged in and teamDataUpdate events can be received that contain a list of all agents in the team.
UPDATEDTeam data has been updated and contains information on the updated logged in agent.
DISABLEDteamDataUpdate events currently can't be received because the agent is logged out.

queueData

Queue items have the following structure:

PropertyTypeDescription
idStringUnique identifier of the queue.
nameStringName of the queue.
channelStringType of channel the queue belongs to. Currently only Voice.
escalationLevelStringThreshold of the queue, calculated based on the configuration (Normal, Warn, Critical).
statisticsObjectStatistic values for this queue. Please see the statistics reference for available data and format.

statistics

PropertyTypeDescription
agentsNotReadyNumberAmount of agents in state Not Ready.
agentsReadyNumberAmount of agents in state Ready.
agentsTalkingInboundNumberAmount of agents in state Talking having an inbound call.
agentsTalkingInternalNumberAmount of agents in state Talking having an agent-to-agent call
agentsTalkingOutboundNumberAmount of agents in state Talking having an outbound call
agentsWrapUpNotReadyNumberAmount of agents in Wrap-Up with follow-up state Not Ready
agentsWrapUpReadyNumberAmount of agents in Wrap-Up with follow-up state Ready
callsInQueueNumberAmount of calls in queue
startTimeOfLongestCallInQueueStringStart date and time of the longest call in queue

Shared Data Structures

Team Data Structure

Enabled Event

When the data state is enabled, the agent is connected and the data structure should resemble the structure below:

{
teamId: '0101',
teamName: 'TEAM_NAME',
teamDataState: 'ENABLED',
teamData: [
{
userId: '000001',
extension: '',
stateChangeTime: '2024-03-30T16:27:49.259Z',
firstName: 'AgentName',
lastName: 'AgentLastName 01',
state: {
state: '0_Logout',
id: '-4',
displayName: '',
origin: '0_SafelyIgnore',
options: []
},
listeningAllowed: false,
watchingAllowed: false
},
{
userId: '000002',
extension: '300002',
stateChangeTime: '2024-03-30T16:27:49.254Z',
firstName: 'AgentName',
lastName: 'AgentLastName 02',
state: {
state: '0_Logout',
id: '-4',
displayName: '',
origin: '0_SafelyIgnore',
options: []
},
listeningAllowed: false,
watchingAllowed: false
},
{
userId: '000003',
extension: '300003',
stateChangeTime: '2024-04-03T17:13:02.349Z',
firstName: 'AgentName',
lastName: 'AgentLastName 03',
state: {
state: '3_NotReady',
id: '-4',
displayName: '',
origin: '0_SafelyIgnore',
options: []
},
listeningAllowed: false,
watchingAllowed: false
}
],
event: 'teamDataUpdate',
version: 1
}

Updated Event

When the data state is updated, the agent is already connected and has one update. The data structure should look like the structure below:

{
teamDataState: 'UPDATED',
teamData: [
{
state: {
id: '0',
origin: '0_SafelyIgnore',
state: '2_Ready',
displayName: '',
options: []
},
id: '0101',
userId: '000001',
firstName: 'AgentName',
lastName: 'AgentLastName 01',
stateChangeTime: '2024-04-03T17:13:24.015Z',
extension: '300001',
listeningAllowed: false,
watchingAllowed: false
}
],
event: 'teamDataUpdate',
version: 1
}

Disabled Event

When the data state is disabled, the agent is disconnected and the data structure should look like the structure below:

{
teamDataState: 'DISABLED',
teamData: [],
event: 'teamDataUpdate',
version: 1
}

Differences between CCE and CCX

This page can't give a complete overview of the differences between CCE and CCX. Please note the following observations as pointers to assist you when planning the integration.

Blind transfer

For CCE there might be an additional call in order to complete the transfer, whereas in CCX only one call is used/signalled.

Receive a call in Not Ready state

When a call is received/placed and the agent state is Not Ready, no agentStateChange (Active) event will be dispatched in CCX.

No queueDataUpdate events in CCX

Since queues are not available in CCX queueDataUpdate events are not available as well.