如何使用 C# SDK 使用团队模板创建团队?

时间:2021-02-09 09:29:13

标签: c# microsoft-graph-api microsoft-graph-sdks microsoft-graph-teams

虽然 documentation 解释了如何使用原始 HTTP 请求创建具有 team template 的团队,但我无法使用 Graph SDK 找到开箱即用的解决方案。< /p>

我能找到的最佳匹配是:

serviceClient.Teams.Request().AddAsync(new Team { Template = new TeamsTemplate { Id = "???", ODataType = "???" } });

但插入模板名称如 standardeducationClass 在上述给定请求中的任何地方都不起作用。那么有没有关于如何使用 SDK 形成请求的文档?

1 个答案:

答案 0 :(得分:1)

我正在使用此请求创建一个带有模板的团队:

await client.Teams.Request().AddAsync(
      new Team
      {
          DisplayName = "My team",
          Description = "desc",
          AdditionalData = new Dictionary<string, object>()
          {
              {"template@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}
          }
      });

如果您的方法不起作用,请查看此 thread 以获取解决方法。