private async void ValidateResponseServiceChatAgent(ResponseServiceChatAgent response) { if (await validatorService.ValidateResponse(response) == false) { return; } string url = string.Format("{0}?name={1}", response.ChatAgent.UrlChatApp, string.Format("{0}({1}-{2})", loginViewModel.User.NameOne, loginViewModel.User.DocumentTypeName, loginViewModel.User.Document)); if (string.IsNullOrEmpty(loginViewModel.User.UserName) == false) { url += string.Format("&email={0}", loginViewModel.User.UserName); } if (string.IsNullOrEmpty(loginViewModel.User.CellPhone) == false) { url += string.Format("&phone={0}", loginViewModel.User.CellPhone); } url += $"&urlService={AppConfigurations.UrlBaseMiddleware}/{AppConfigurations.ServicesController}/{AppConfigurations.ServiceChatAgent}"; url += $"&urlServiceApiKey={AppConfigurations.Subscriptionkey}"; url += $"&serviceType={(int)ServiceType.Other}"; url += $"&environment={AppConfigurations.Environment}"; byte[] utf8bytes = Encoding.UTF8.GetBytes(url); string r = Encoding.UTF8.GetString(utf8bytes, 0, utf8bytes.Length); HtmlSource.Url = r; }
public async Task LoadChatPage() { phoneService.DeleteCookie(); RequestServiceChatAgent request = new RequestServiceChatAgent(); ResponseServiceChatAgent response = await apiService.GetServiceChatAgent(request); ValidateResponseServiceChatAgent(response); }