我试图在没有结果的情况下使用educationClass模板在教育租户中创建一个团队,使用Microsoft Graph SDK for C#。这是官方网站(https://docs.microsoft.com/es-es/graph/api/team-post?view=graph-rest-beta&tabs=csharp)推荐的带有 BETA api 的代码。
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
AdditionalData = new Dictionary<string, object>()
{
{"template@odata.bind", "https://graph.microsoft.com/beta/teamsTemplates('educationClass')"},
{"owners@odata.bind", "[\"https://graph.microsoft.com/beta/users('userId')\"]"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
当我执行此代码时,它会引发以下错误: Microsoft.Graph.ServiceException: 'Code: BadRequest Message: Invalid URL format specified in @odata.bind for owner
谢谢!