Error when try to patch team Rest Api

Rodrigo Nascimento 20 Reputation points
2023-08-03T20:11:28.2366667+00:00

Hello, I'm trying to alter a team using the API endpoint v1.0/teams/. Recently, I encountered an error using this API that was not happening before.

The response I'm getting is a bad request. While searching for the problem, I came across the field called "visibility":

https://learn.microsoft.com/en-us/graph/api/team-update?view=graph-rest-1.0&tabs=http

https://learn.microsoft.com/pt-br/graph/api/resources/teamvisibilitytype?view=graph-rest-1.0

This link provides options for the "visibility" field. When I use 0 or 1 as the value, I get a bad request error, but it works fine when I use 2 as the value.

Sample JSON Code:



The code above works fine, but if I change the "visibility" to any other value, the error occurs. It used to work fine before, but I'm not sure if something has changed recently. Is anyone else experiencing something like this?

Thanks

Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Answer accepted by question author
  1. Vasil Michev 123.7K Reputation points MVP Volunteer Moderator
    2023-08-04T15:58:51.0966667+00:00

    Enum members should always be referenced by their string value, that's a best practice. That said, "hiddenMembership" can only be set when creating a new Team/Group, so this is the likely reason why your request fails.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.