Forum Discussion
Microsoft Graph Api - Create team Visibility : HiddenMembership error
Hi.
I've been create a team using this code in c#, using Microsoft Graph Api.
var additionalData = new Dictionary<string, object>() {
{
"template@odata.bind",
"https://graph.microsoft.com/beta/teamsTemplates('educationClass')"
}, {
"owners@odata.bind",
new List<string>()
}
};
(additionalData["owners@odata.bind"] as List < string >).Add("https://graph.microsoft.com/v1.0/users/" + ownId);
var team = new Team {
DisplayName = displayName,
Description = description,
AdditionalData = additionalData
};
await graphClient
.Teams
.Request()
.AddAsync(team);
But there was an error all of a sudden today. As follows
Team Definition. Visibility' should be equal to 'HiddenMembership'
So I set the Visibility option.
Visibility = TeamVisibilityType.HiddenMembership
But error occured like this..
Team Visibility must be one of known types: [Private,Public,HiddenMembership]
There is also no information on 'HiddenMemberhip' in https://docs.microsoft.com/en-us/graph/api/resources/teamvisibilitytype?view=graph-rest-beta
The Visual studio nuget manager also upgraded to the latest beta version.
License is Education A1.
13 Replies
- LeandroJJCopper Contributor
Hi. BoHyun
Try with the v1.0 and make the request in the following way:
{ "template@odata.bind":"https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')", "displayName":"My Sample Team", "description":"My Sample Team’s Description", "members":[ { "@odata.type":"#microsoft.graph.aadUserConversationMember", "roles":[ "owner" ], "user@odata.bind":"https://graph.microsoft.com/v1.0/users('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')" } ] } - stefanpe
Microsoft
BoHyun JElliott Sjoerd1185 SteveDubois Matt-Hurford MaxCSA Good news: now everything works again as a few days ago!! I just noticed that the issue "TM2274400" was closed by Microsoft. I tried again using my PowerShell + Graph code for creating EducationClass teams: it works!
- JElliottBrass ContributorLooking at the Service health area of the 365 admin center, i can also see that this issue is somewhat covered by an advisory. i don't know how to post links to official service health area, but the university of pennsylvania is mirroring it on their site: https://mailservices.isc.upenn.edu/computing/email/penno365/alerts/ms-incidents.html id: TM2274400
Admins are unable to create teams using the Microsoft Graph API when a group is specified
TM227440, Microsoft Teams, Last updated: November 24, 2020 4:27 AM
Start time: November 23, 2020 11:07 PM - JElliottBrass ContributorI'm having the same issue, I think creating the group first and then applying a Teams template to it might be a workaround while waiting on a fix to the beta endpoints: https://docs.microsoft.com/en-us/graph/api/team-post?view=graph-rest-beta&tabs=http#example-4-create-a-team-from-group
Before this problem, I hadn't realised you could create a templated team from an existing group. I haven't tried yet, but hope it works as have a lot of people waiting on Teams being created from a recent change in timetables. my only worry is i know that the educationClass template with Teams usually applies a number of settings on the underlying created 365 group, like not sending out the email for users joining, etc.- Matt-HurfordCopper Contributor
JElliott
But can you add a class notebook to a team that wasn't created with an educationClass template? - SteveDuboisCopper Contributor
Seems to be a reasonable temporary solution.
Can you keep us updated about the outcomes of your tests?
Would be very apreciated.
I will do the same if I find the time to test it myself.
- JElliottBrass Contributor
I created a group with matching settings (HiddenMembership, autosubscribe, etc) and then tried to create a Team using that group and the educationClass template, no joy =(
POST:
{ "template@odata.bind":"https://graph.microsoft.com/beta/teamsTemplates('educationClass')", "group@odata.bind":"https://graph.microsoft.com/v1.0/groups('groupid')" }Response:
{ "error": { "code": "BadRequest", "message": "Failed to execute Templates backend request CreateTeamFromGroupWithTemplateRequest. Request Url: https://teams.microsoft.com/fabric/emea/templates/api/groups/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/team, Request Method: PUT, Response Status Code: BadRequest, Response Headers: Strict-Transport-Security: max-age=2592000\r\nx-operationid: xxxxxxxxxxxx\r\nx-telemetryid: 00-xxxxxxxxxxxx-xxxxxxxxxxxx-00\r\nX-MSEdge-Ref: Ref A: xxxxxxxxxxxx Ref B: DB3EDGE1609 Ref C: 2020-11-24T12:29:42Z\r\nDate: Tue, 24 Nov 2020 12:29:42 GMT\r\n, ErrorMessage : {\"errors\":[{\"message\":\"Team Visibility can not be specified as it is inherited from the group.\"}],\"operationId\":\"xxxxxxxxxxxx\"}", "innerError": { "date": "2020-11-24T12:29:42", "request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "client-request-id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } } }Team Visibility can not be specified as it is inherited from the group.
So, even though I'm not specifying visibility in the creation request, it's picking up HiddenMembership from the pre-created group and somehow it's interfering with the template. Well and truly messed up it seems.
I haven't tried creating a class from just Teams (without using Graph) but I wonder if it's having the same issues.
I hope that the solution here isn't to create a class through the /education endpoint that then gets a team created for it by the teacher.
quick edit: I also tested this on the v1.0 graph API with the same errors. so, this is not just a "beta" issue, it's affecting production endpoints as well.
- SteveDuboisCopper ContributorSame problem here... we really need this.
Please keep us updated. - emi662002Copper Contributor
- MaxCSACopper ContributorHi,
We have the same issue since yesterday.
We'll keep you posted if we find a solution. Please do the same 🙂
Regards- stefanpe
Microsoft