[SOLVED] Mattermost V3 to V4 upgrade - Team api v4

Hi Team,

I am trying to update mattermost api fom v3 version to v4 version .
We were using “Get all teams” Endpoint -https://your-mattermost-url.com/api/v3/teams/all , this used to give us all the teams which user has access to , i am unable to find the equivalent endpoint in v4 version , however i tried using “Get teams” api in v4 version having endpoint –https://your-mattermost-url.com/api/v4/teams , it does not give all the open teams the user has subscribed to(i found that the subscribed teams are open team through v3 api)

Also , tried using "Get a team " v4 version , but instead of providing details of the team id provided ,it is giving the details of all the teams (response is same as Get all teams ).

Please note we have created a service account for our application and reading the data through that account and interested in reading public data only.

Can you please suggest in case we are missing something here.

Any help will be much appreciated !!

Thanks,
Geetika

Hi Team

Did you get a chance to look at the request ? We need to push the v4 version changes to production for our application after full round of SIT and Regression tests before v3 version is decommissioned .

Early response will be much appreciable !!

Please let me know in case any information is required from my side.

Thanks,
Geetika

Hi @Geetika_Dwivedi,

Have you tried this endpoint? It should have similar behavior to the GET /api/v3/teams/all endpoint, the only difference being that system admins won’t have different behavior than a regular user.

Thanks @jwilander for the inputs.

Hi @jwilander , as suggested I started using v4 version. Of ‘get teams’ API to fetch the missing teams with the user having ‘managed_system permissions’ ,can you please confirm the API response will contain both the types of team i.e. type ‘I’ invite only and ‘O’ open teams with their respective types or the ‘managed_system’ permission will change the type of all teams to ‘O’.

Thanks

This endpoint will return all the teams for a user regardless of type, and it should not modify any types before returning. Having the manage_system permission for this endpoint just allows you to request the teams for users that are not you.

The get teams endpoint will only return teams that allow any user to join, essentially any team with allow_open_invite set. If you have manage_system permission, this endpoint will return all teams regardless of allow_open_invite or type.