以编程方式将SharePoint Library Teams选项卡添加到Microsoft Teams Channel

贝威

我正在尝试SharePoint Library通过Microsoft Graph以编程方式将选项卡添加到Microsoft Team Channel。这是我通过图形资源管理器发送的有效负载POST

{
    "teamsAppId": "com.microsoft.teamspace.tab.files.sharepoint",
    "name": "Documents3",
    "sortOrderIndex": "10300",
    "configuration": {
        "siteUrl": "https://baywet.sharepoint.com/sites/customerhub",
        "libraryServerRelativeUrl": "/sites/customerhub/Shared Documents",
        "selectedDocumentLibraryTitle": "Documents",
        "selectedSiteTitle": "customerhub",
        "dateAdded": "2018-10-05T16:56:59.169Z"
    }
}

我收到201状态响应,我的标签已添加到频道。但是,每当有人尝试从Teams UI上传文件时,他们都会收到以下错误消息The File {filename} is missing如果他们单击Open in SharePoint然后上传文件,则该文件有效。如果将我与通过UI创建的选项卡(可以正常工作)进行比较,这是我得到的描述。
团队错误消息

{
    "id": "a68e34db-9d43-4821-953b-2dec938ce785",
    "name": "Document%20Library",
    "teamsAppId": "com.microsoft.teamspace.tab.files.sharepoint",
    "sortOrderIndex": "10200",
    "webUrl": "https://teams.microsoft.com/l/channel/19%3ab2e05a0aae42487485b13e088d5d2f0f%40thread.skype/tab%3a%3aa63916e6-f252-477d-9696-7934980e7e47?label=Document%2520Library&groupId=71ed6a2e-67ca-4930-a3c2-abb25ca29fbf&tenantId=bd4c6c31-c49c-4ab6-a0aa-742e07c20232",
    "configuration": {
        "entityId": null,
        "contentUrl": null,
        "removeUrl": null,
        "websiteUrl": null,
        "siteUrl": "https://baywet.sharepoint.com/sites/customerhub",
        "libraryServerRelativeUrl": "/sites/customerhub/Shared Documents",
        "libraryId": "706FAD5678484E7B93B0855E52A0BCD9",
        "selectedDocumentLibraryTitle": "Documents",
        "selectedSiteImageUrl": "https://baywet.sharepoint.com/sites/customerhub/_api/GroupService/GetGroupImage?id='f9d430ca-4de3-42f1-9474-1427bfdb16b0'&hash=636743460492415245",
        "selectedSiteTitle": "customerhub",
        "dateAdded": "2018-10-05T16:56:59.169Z"
    }
}

唯一的区别是libraryId配置值。(您不应该发送webUrl和id)。该库ID与SharePoint中的库ID不匹配,或者在Graph中与驱动器项目ID不匹配,所以我的问题是:我应该为libraryId设置什么值还有什么我想念的吗?

贝威

一段时间后,我找到了解决方案,很抱歉没有在此之前发布。

POST https://graph.microsoft.com/beta/teams/{groupId}/channels/{channelId}/tabs

{
    "[email protected]": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/com.microsoft.teamspace.tab.files.sharepoint",
    "name": "test",
    "sortOrderIndex": "10400",
    "configuration": {
        "contentUrl": "https://baywet.sharepoint.com/sites/NYC/test"
    }
}

其中contentUrl是文档库的URL

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何将选项卡添加到Microsoft Teams Bot?

以编程方式将机器人 (ms-botbuilder) 添加到 MS Teams 团队/频道

无法将已安装的 MS Teams 应用程序添加为选项卡

如何使用C#自动将联系人添加到Microsoft Teams组

将 TFS 加载项添加到 Teams

Microsoft Teams选项卡X-框架-选项

C#WinForms,将选项卡添加到选项卡控件,然后以编程方式将控件添加到每个选项卡

选项卡未显示在 Microsoft Teams Bot 上

无法在Microsoft Teams中将Planner创建为选项卡

列出Microsoft Teams选项卡总是返回404

从Bot到Microsoft Teams中的选项卡的深层链接

将超链接添加到要在MS Teams上显示的自适应卡1.0中的网页

将 1:1 机器人加载为 Teams 中的选项卡

如何以编程方式将图像添加到选项卡布局?

如何以编程方式将图像添加到WPF选项卡控件项

无法在AppDelegate中以编程方式将viewContoller添加到选项卡栏

将添加选项卡添加到TemplateRole

SharePoint 页面未在静态应用程序的个人选项卡中加载(MS Teams 桌面客户端)

无法将 Jenkins 连接器添加到 Teams 频道 - 表示已添加

如何在没有教育许可证的情况下在Microsoft Teams中添加分配选项卡

将选项卡添加到现有项目

将选项卡添加到TabPane JavaFX

jQuery将类添加到活动选项卡

使用片段将图像添加到选项卡

将图像添加到选项卡

将焦点添加到当前选项卡

将课程添加到Drupal 7选项卡

动态将选项卡添加到TabControl容器

将行为添加到Wicket选项卡