internal static void SendClientMessage(Connection conn, TextMessage msg)
        {
            LinkCaseMessagePost message = new LinkCaseMessagePost
            {
                CustomerId     = conn.CustomerId,
                Date           = DateTime.Now,
                Message        = msg.Text,
                RefId          = conn.RefId,
                SendEmail      = false,
                SendEmailTo    = string.Empty,
                SendPush       = false,
                SubscriptionId = Guid.Parse(conn.SubscriptionId)
            };
            Uri baseAddress = new Uri("https://cotoapp-lab-appservice.azurewebsites.net/");

            HttpClient httpclient = new HttpClient();

            httpclient.BaseAddress = baseAddress;

            HttpResponseMessage resp = httpclient.PostAsJsonAsync("api/LinkCaseMessage", message).Result;

            //if (!resp.IsSuccessStatusCode)

            resp.EnsureSuccessStatusCode();
            var result = resp.Content.ReadAsStringAsync().Result;
            SubscriptionResult subscriptionResult = JsonConvert.DeserializeObject <SubscriptionResult>(result);
        }
        private static string getSubscription(string customerId, Guid linkChannelId, string userName)
        {
            //data contract servicio primero
            LinkCustomerSubscriptionNew lcsn = new LinkCustomerSubscriptionNew {
                CustomerId = customerId, LinkChannelId = linkChannelId, UserName = userName
            };
            //base uri
            Uri baseAddress = new Uri("https://cotoapp-lab-appservice.azurewebsites.net/");
            //Uri baseAddress = new Uri("http://localhost:62888/");

            HttpClient httpclient = new HttpClient();

            httpclient.BaseAddress = baseAddress;

            HttpResponseMessage resp = httpclient.PostAsJsonAsync("api/LinkCustomerSubscription", lcsn).Result;

            if (!resp.IsSuccessStatusCode)
            {
                return(string.Empty);
            }

            resp.EnsureSuccessStatusCode();
            var result = resp.Content.ReadAsStringAsync().Result;
            SubscriptionResult subscriptionResult = JsonConvert.DeserializeObject <SubscriptionResult>(result);

            return(subscriptionResult.SubscriptionId);
        }