Microsoft.CIFramework methods (JavaScript API reference) for Dynamics 365 Channel Integration Framework 2.0

Microsoft CIFramework provides methods to use JavaScript API to manage the communication panel (widget), notification, application tab, sessions, records, and forms in the Dynamics 365 model-driven app.

Important

  • The APIs are supported only from the active channel providers configured in your organization.
  • The CIFInitDone event handler must be invoked before calling the other APIs.
  • The time-out limit for the APIs is 100 seconds. If the APIs don't run within 100 seconds, they must be run again with changed parameters or scope.

Communication panel management APIs

The communication panel is where you as an agent interact with the customer. Partner widgets built using Channel Integration Framework 2.0 are loaded in this panel. The widget in this version is displayed to the left of the session panel and supports Docked, Minimized, and Hidden modes.

Use the following APIs to manage the state of the communication panel (widget).

Methods Description
setWidth Sets the panel width for all the sessions.
getWidth Gets the panel width in pixels.
setMode Sets the state of the panel.
getMode Sets the state of the panel.

CRUD operations APIs

Use the following APIs to perform CRUD operations on entity records.

Methods Description
createRecord Creates an entity record.
retrieveRecord Retrieves an entity record.
updateRecord Updates an entity record.
deleteRecord Deletes an entity record.

Notification management APIs

Use the following APIs to display or cancel notifications about incoming conversations.

Methods Description
notifyEvent Displays a notification that can be used to inform agent about an incoming conversation.
cancelEvent Hides or cancels a notification based on the cancellation token, as specified in the notifyEvent method.

Application tab management APIs

Use the following APIs to create and manage the state of an application tab.

Methods Description
createTab Creates a tab in a focused session and returns the unique identifier of the created tab.
getTabs Returns an array of tab identifiers associated with template name or template tags for tabs in the session in focus, if the session belongs to the channel provider.
focusTab Sets the focus on a tab, if the focused session belongs to the channel provider and if the tab belongs to the session in focus.
getFocusedTab Returns the tab identifier in a focused session, if the session belongs to the provider.
refreshTab Refreshes the tab.
setTabTitle Sets the title of the tab, if the focused session belongs to the channel provider and if the tab belongs to the session in focus.
closeTab Closes the specified tab in the current session.

Session management APIs

Use the following APIs to manage sessions in a multisession provider environment.

Methods Description
canCreateSession Allows you to check if a new session can be created.
createSession Creates a session based on the session template defined as part of the template and returns the unique identifier of the session that was created.
getSession Returns an object containing the unique identifier of the session, context, and the value of isFocused parameter, if the session belongs to the channel provider.
getFocusedSession Returns the unique identifier of the session that is in focus, if it belongs to the channel provider else returns null.
getAllSessions Returns the array of session identifiers for a channel provider.
setSessionTitle Sets the session title, if the session belongs to the channel provider.
requestFocusSession Sets the focus on the session whose session identifier is passed as a parameter, if the session belongs to the channel provider.

Channel analytics APIs

Use the following APIs to track event analytics.

Methods Description
logAnalyticsEvent Invoke this method to log analytics for custom events.

Session indicator APIs

Use the following APIs to indicate a key performance indicator (KPI) breach and to update the number of new activities in a particular session.

Methods Description
notifyKpiBreach This method is used to indicate a KPI breach. When this method is used, a red circle appears on the display image of the contact when a KPI breach has occurred.
notifyNewActivity This method is used to update the number of new activities in a particular session.

Presence APIs

Use these APIs to set and retrieve the Omnichannel agent presence programmatically. You can use these methods when a blended agent is working on a third-party application with omnichannel, and you want to synchronize the presence states between different applications to ensure that agent capacity is optimally utilized.

Methods Description
setPresence​ Allows presence to be set programmatically for the agent in the client session​.
getPresence​ Allows presence to be returned programmatically for the agent in the client session​.

Miscellaneous methods

Methods Description
getEntityMetadata Returns the entity metadata for the specified entity.
setClickToAct Sets a Boolean value to enable or disable the outbound communication (ClickToAct).
getClickToAct Returns a Boolean value to indicate whether the outbound communication (ClickToAct) is enabled or not.
searchAndOpenRecords The method searches for the record from the communication widget during the inbound communication and opens the record.
getEnvironment Gets the current Unified Interface app and page details. The details include application ID(appid), pageType(pageType), record ID(id), organization geography (orgGeo) and session navigation type (navigationType).
openForm Opens an entity form or a quick create form.
renderSearchPage Allows you to search among the records of a particular entity type. This API opens the Unified Interface entity page with the search field on it prepopulated with the search string that is passed as a parameter.
addHandler Adds the subscriber to the events.

Note

This API can be used on both the widget and Unified Interface page.

removeHandler Removes the subscriber from the events.

Note

This API can be used on both the widget and Unified Interface page.

raiseEvent Invokes the associated subscriber for the event.

Note

If you've created custom events using the addHandler method, then you can raise those events by passing the event name as parameter in this method.

updateContext This method allows you to set the automation dictionary.
updateConversation This method allows you to update a conversation record.

See also

What's new in Dynamics 365 Channel Integration Framework
System requirements for Dynamics 365 Channel Integration Framework 2.0