An API that connects multiple Microsoft services, enabling data access and automation across platforms
HI @Anonymous ,
As per your error description I can see you are using application permission to create a team and when issuing a request with application permissions, a user must be specified in the members collection. Please follow this documentation.
Use request body like below:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var team = new Team
{
DisplayName = "My Sample Team",
Description = "My Sample Team’s Description",
Members = new TeamMembersCollectionPage()
{
new AadUserConversationMember
{
Roles = new List<String>()
{
"owner"
},
AdditionalData = new Dictionary<string, object>()
{
{"******@odata.bind", "https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')"}
}
}
},
AdditionalData = new Dictionary<string, object>()
{
{"******@odata.bind", "https://graph.microsoft.com/v1.0/teamsTemplates('standard')"}
}
};
await graphClient.Teams
.Request()
.AddAsync(team);
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.