inviteGuestsToTeam method
Future<MmStatusOK?>
inviteGuestsToTeam(
- String teamId,
- MmInviteGuestsToTeamRequest mmInviteGuestsToTeamRequest
Invite guests to the team by email
Invite guests to existing team channels usign the user's email. The number of emails that can be sent is rate limited to 20 per hour with a burst of 20 emails. If the rate limit exceeds, the error message contains details on when to retry and when the timer will be reset. Minimum server version: 5.16 ##### Permissions Must have invite_guest
permission for the team.
Parameters:
-
String teamId (required): Team GUID
-
MmInviteGuestsToTeamRequest mmInviteGuestsToTeamRequest (required): Guests invite information
Implementation
Future<MmStatusOK?> inviteGuestsToTeam(
String teamId,
MmInviteGuestsToTeamRequest mmInviteGuestsToTeamRequest,
) async {
final response = await inviteGuestsToTeamWithHttpInfo(
teamId,
mmInviteGuestsToTeamRequest,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw MmApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(
await _decodeBodyBytes(response),
'MmStatusOK',
) as MmStatusOK;
}
return null;
}