1

Microsoft Graph SDK for C# を使用して、educationClassテンプレートを使用して教育テナントにチームを作成しようとしていますが、結果はありません。これは、公式 Web サイト ( 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

ありがとうございました!

4

1 に答える 1