适用于 Dynamics 365 渠道集成框架 2.0 的 getAllSessions(JavaScript API 参考)

注释

此内容仅适用于 Dynamics 365 渠道集成框架版本 2.0。

注释

会话管理 API 允许您仅在 Copilot 服务工作区应用中集成多会话体验。

返回提供程序的会话标识符数组。

Syntax

Microsoft.CIFramework.getAllSessions().then(successCallback, errorCallback);

参数

名称 类型 Required 说明
successCallback 回调 功能 Call when the promise is solve(当 Promise 被解析时调用)
errorCallback 回调 功能 拒绝承诺时调用

返回值

Promise 将值作为会话 ID 数组,这些 ID 由提供程序创建并且仍处于活动状态。

Example

Microsoft.CIFramework.getAllSessions().then(
    function (result) {
        // result will have array of session Ids, which are created by the provider and still at active state.
        console.log(result)
    },
    function (error) {
        // code handling for promise failure
        console.log(error)
    });