英文:
Identifying the Sharepoint site linked to a Team created through the Microsoft Graph api
问题
我目前正在构建一个为'项目'设置团队的系统,并希望自动上传必要的文件。团队中的文件选项卡与一个 SharePoint 站点相关联,我可以通过 Teams 手动获取该站点的链接,但我找不到任何形式的链接到该站点或在 API 响应中找不到 ID。我已经查阅了文档,但没有找到任何信息,感谢任何帮助。
我已尝试将团队 ID 用作站点 ID,以及任何其他 ID 或路径,在'获取站点'请求中使用了来自 teamsAsyncOperation 返回的数据,但都返回了{"code": "itemNotFound","message": "未找到项目"}。
英文:
I am currently building a system that sets up a team for a 'project', and want to automate the upload of necessary documents. The files tab in the team is linked to a sharepoint site which i can get the link to manually through Teams, but i cant find any form of link to the site, or ID in the api response. I have looked through the documentation and cant find anything, any help would be appreciated.
I have tried using the team ID as the site ID, aswell as any other ID or path, in a 'get site' request. i have used the data returned from the teamsAsyncOperation in the same manner. Which all return {"code": "itemNotFound", "message": "Item not found"}
答案1
得分: 1
团队频道中的“文件”选项卡通过与 driveItem 的 filesFolder 关联进行了链接。
要获取频道中的文件存储位置的元数据,您需要使用 teamId
和 channelId
。
GET /teams/{teamId}/channels/{channelId}/filesFolder
响应应包含 driveItem
的 id
和具有 driveId
的 parentReference
。
现在您有了 driveId
和 driveItemId
,因此可以使用以下 端点 上传文档。
英文:
The files tab in the team's channel is linked to a driveItem through filesFolder relationship.
To get the metadata for the location where the files of a channel are stored you need to use teamId
and channelId
.
GET /teams/{teamId}/channels/{channelId}/filesFolder
The response should contain id
of driveItem
and parentReference
with driveId
.
Now you have driveId
and driveItemId
, so you can upload documents using the following endpoint.
答案2
得分: 1
你可以通过<groupid>/sites/root访问一个团队站点。
尝试类似以下的操作:
https://graph.microsoft.com/v1.0/groups/<groupid>/sites/root?$select=webUrl
您可以重用创建团队请求中的团队 ID。该 ID 应该在响应标头的 Content-Location 字段中列出。您可以通过slice函数检索它。
slice(outputs('Send_an_HTTP_request_-_Create_Team')['Headers']['Content-Location'], 8, -2)
英文:
You can access a group team site via <groupid>/sites/root
https://learn.microsoft.com/en-us/graph/api/site-get?view=graph-rest-1.0&tabs=http#access-a-group-team-site
Try something like:
https://graph.microsoft.com/v1.0/groups/<groupid>/sites/root?$select=webUrl
You can reuse the Group Id from the Create Team request. That id should be listed in the Content-Location field of the Response Headers. You can retrieve that via a slice function.
slice(outputs('Send_an_HTTP_request_-_Create_Team')['Headers']['Content-Location'], 8, -2)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论