如何为Outlook和Microsoft团队设置连接器?

时间:2019-05-12 20:41:46

标签: outlook microsoft-teams office365connectors

我正在为MS Teams和Outlook建立连接器。我已经在Connector Developer Dashboard上注册了该连接器,但是当我将其侧向加载到Outlook并尝试配置该连接器时...在我的设置页面中没有任何反应。确实,

microsoftTeams.settings.getSettings不起作用。

microsoftTeams js库也适用于Outlook吗?如果没有,我该怎么办?

“连接到Office 365按钮”似乎并不是正在进行的工作。

团队和Outlook之间包含无效链接和混合文档的文档无济于事:(

谢谢!

编辑1:

在我的配置页面上调用了AngularJS代码:

    $scope.setValidateState = function() {
        microsoftTeams.settings.setValidityState(true);
    };

    $scope.authenticate = function() {
        microsoftTeams.authentication.authenticate({
            url: isSettings.serverUrl + '/microsoft/auth-start/',
            with: 500,
            height: 800,
            successCallback: function(data) {
                $scope.isAuthenticated = data && data['accessToken'];
                localStorage.setItem("microsoft-oauth", JSON.stringify(data));
                displayConfiguration();
            },
            failureCallback: function(reason) {
                console.log(reason);
            }
        });
    };

    function displayConfiguration() {
        microsoftTeams.settings.setValidityState(true);
        microsoftTeams.settings.registerOnSaveHandler(function(saveEvent) {
            microsoftTeams.settings.setSettings({
                entityId: 'icescrum-connector-pkey-' + $scope.settings.project.pkey,
                contentUrl: isSettings.serverUrl + '/microsoft/setup/',
                configName: $scope.settings.project.name
            });
            microsoftTeams.settings.getSettings(function(settings) {
                $scope.settings.webhookUrl = settings.webhookUrl;
                console.log(settings.webhookUrl);
                saveEvent.notifySuccess();
            });
        });

        microsoftTeams.settings.getSettings(function(settings) {
            $scope.setup = !settings.configName;
            ProjectService.listByUserAndRole(Session.user.id, 'productOwner', {light: true}).then(function(projects) {
                $scope.projects = projects;
                if (settings.entityId) {
                    $scope.settings.project = _.find($scope.projects, {pkey: settings.entityId.split('icescrum-connector-pkey-')[1]});
                }
                $scope.ready = true;
            });
        });
    }

    // Init
    $scope.settings = {};
    $scope.projects = [];
    $scope.ready = false;
    var tokenData = JSON.parse(localStorage.getItem("microsoft-oauth"));
    $scope.isAuthenticated = tokenData && tokenData['accessToken'];

    microsoftTeams.initialize();

    if($scope.isAuthenticated){
        displayConfiguration();
    }

我的manifest.json:

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.3/MicrosoftTeams.schema.json",
  "manifestVersion": "1.3",
  "id": "a15dcb92-35af-400e-ab9b-99efda40138f",
  "version": "1.0.0",
  "packageName": "com.iceScrum2",
  "developer": {
    "name": "Developer",
    "websiteUrl": "https://www.icescrum.com",
    "privacyUrl": "https://www.icescrum.com",
    "termsOfUseUrl": "https://www.icescrum.com"
  },
  "description": {
    "full": "iceScrum connector",
    "short": "integration iceScrum with Microsoft Teams with a bot, a connector and a tab"
  },
  "icons": {
    "outline": "icescrum-icon-32x32.png",
    "color": "icescrum-icon-192x192.png"
  },
  "connectors": [
    {
      "connectorId": "a15dcb92-35af-400e-ab9b-99efda40138f",
      "scopes": [
        "team"
      ],
      "configurationUrl": "https://icescrum.ngrok.io/icescrum/microsoft/setup/"
    }
  ],
  "name": {
    "full": "iceScrum2",
    "short": "iceScrum2"
  },
  "accentColor": "#FFFFFF",
  "validDomains": [
    "*.icescrum.com",
    "icescrum.ngrok.io"
  ]
}

1 个答案:

答案 0 :(得分:1)

我的Microsoft Teams js库已过时(1.3.4)。在最新版本(1.4.1)中,它可以在Outlook和团队中正常使用。