gpt4 book ai didi

microsoft-graph-api - 使用 Graph 创建私有(private) channel 后,需要几分钟才能使用选项卡端点

转载 作者:行者123 更新时间:2023-12-03 17:22:33 27 4
gpt4 key购买 nike

我正在使用 Graph 在现有团队中创建一个新的私有(private) channel 。在此之后,我想在该 channel 中创建一个新选项卡。在对 tabs 端点进行 POST 时,我几乎总是收到带有消息 No active channel found with channel id: 19:690... 的 404 NotFound但是在创建私有(private) channel 后等待几分钟后,选项卡端点可用,我可以创建选项卡。
如果创建标准 channel ,这总是成功的。
我可以使用 Graph SDK 和 Graph Explorer 重现这一点。
我可以在使用 Graph SDK 以下列方式创建 channel 后尝试列出可用选项卡,以便能够看到问题:

    var graphClient = new GraphServiceClient(authProvider);

var channelRequest = new Channel()
{
DisplayName = "Test",
MembershipType = ChannelMembershipType.Private,
Members = new ChannelMembersCollectionPage()
{
new AadUserConversationMember
{
Roles = new List<String>()
{
"owner"
},
AdditionalData = new Dictionary<string, object>()
{
{"user@odata.bind", "https://graph.microsoft.com/v1.0/users('{user-id}')"}
}
}
}
};

var channel = await graphClient.Teams[teamId].Channels
.Request()
.AddAsync(channelRequest);

//The following will be successful so we can see that the channel has been created
var newChannel = await graphClient.Teams[teamId].Channels[channel.Id]
.Request()
.GetAsync();

//The following will return an error saying No active channel found with channel id: 19:690... but after waiting a few minutes this would be successful
var newChannelTabs = await graphClient.Teams[teamId].Channels[channel.Id].Tabs
.Request()
.GetAsync();
其他人看到同样的问题还是我错过了什么?
编辑
在 Graph Explorer 中重现的步骤:
  • 在 SharePoint
  • 中创建一个名为 Test 的新团队网站
  • 获取群组ID:GET https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'Test'&$select=id
  • 为组启用团队:PUT https://graph.microsoft.com/v1.0/groups/{groupId}/team带有请求正文 { "memberSettings": { "allowCreatePrivateChannels": true, "allowCreateUpdateChannels": true }, "messagingSettings": { "allowUserEditMessages": true, "allowUserDeleteMessages": true }, "funSettings": { "allowGiphy": true, "giphyContentRating": "strict" } }
  • 在团队中创建一个新的私有(private) channel :POST https://graph.microsoft.com/v1.0/teams/{groupId}/channels带有请求正文 { "displayName": "PrivateChannel1", "membershipType": "private", "members": [ { "@odata.type": "#microsoft.graph.aadUserConversationMember", "user@odata.bind": "https://graph.microsoft.com/v1.0/users('{user id for an existing user}')", "roles": [ "owner" ] } ] }
  • 获取私有(private) channel 的标签:GET https://graph.microsoft.com/v1.0/teams/{groupId}/channels/{channelId for the private channel}/tabs

  • 我在 Graph Explorer 中对此进行测试时得到的结果是,第一个 channel 看起来不错,但是在创建第二个和第三个 channel 时,我开始看到 404 NotFound 的问题。我还看到我之前关于错误在几分钟后消失的假设是不正确的,对于第三个 channel ,我仍然在 30 分钟后在大约一半的尝试中得到错误。
    上周左右,我们在多个客户租户中看到了这个问题,但截至今天,我只能在一个租户中重现它。

    最佳答案

    从@nikiha 的评论中获得更好的可见性应对答案
    当您使用图形 API 创建 channel 时,需要一些时间来更新。在创建 channel 后将选项卡添加到创建的 channel 将失败。如问题中所述,我们需要等待 SPO 配置异步 channel 创建成功。创建 channel 几分钟后,您是否遇到任何问题?您是否无法在一段时间后列出 channel 的标签?

    关于microsoft-graph-api - 使用 Graph 创建私有(private) channel 后,需要几分钟才能使用选项卡端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66342224/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com