“Identifying the Sharepoint site linked to a Team created through the Microsoft Graph API.”

huangapple go评论69阅读模式
英文:

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

团队频道中的“文件”选项卡通过与 driveItemfilesFolder 关联进行了链接。

要获取频道中的文件存储位置的元数据,您需要使用 teamIdchannelId

GET /teams/{teamId}/channels/{channelId}/filesFolder

响应应包含 driveItemid 和具有 driveIdparentReference

现在您有了 driveIddriveItemId,因此可以使用以下 端点 上传文档。

英文:

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/&lt;groupid&gt;/sites/root?$select=webUrl

您可以重用创建团队请求中的团队 ID。该 ID 应该在响应标头的 Content-Location 字段中列出。您可以通过slice函数检索它。

slice(outputs(&#39;Send_an_HTTP_request_-_Create_Team&#39;)[&#39;Headers&#39;][&#39;Content-Location&#39;], 8, -2)

“Identifying the Sharepoint site linked to a Team created through the Microsoft Graph API.”

英文:

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&amp;tabs=http#access-a-group-team-site

Try something like:

https://graph.microsoft.com/v1.0/groups/&lt;groupid&gt;/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(&#39;Send_an_HTTP_request_-_Create_Team&#39;)[&#39;Headers&#39;][&#39;Content-Location&#39;], 8, -2)

“Identifying the Sharepoint site linked to a Team created through the Microsoft Graph API.”

huangapple
  • 本文由 发表于 2023年5月11日 03:52:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222133.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定