我正在尝试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] 删除。
我来说两句