public async Task RequestPermissionToGroup(string authenticationToken, string groupId, string userId) { try { UserGroupService groupService = new UserGroupService(); var response = await groupService.RequestPermissionToGroup(authenticationToken, groupId, userId); if (!response.IsSuccessStatusCode) { if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) { throw new Exception("Unauthorized"); } else { throw new Exception(response.StatusCode.ToString() + " - " + response.ReasonPhrase); } } } catch (Exception ex) { throw new Exception(ex.Message); } }