Example #1
0
        private string EnviarNotificacionACanal(string linkMeeting, string cliente, string producto)
        {
            string jsonRequest = ArmarBodyNotificacionCanal(linkMeeting, cliente, producto);

            using (var clientMeeting = new HttpClient())
            {
                CompletarHeader(token, clientMeeting);

                Dictionary <string, string> configuracion = new ConfiguracionService().ObtenerConfiguracion();
                var teamId    = configuracion["teamId"];
                var channelId = configuracion["channelId"];
                if (configuracion["config"] == "mongo")
                {
                    var configuracionMongo = new MongoService().ObtenerConfiguracion();
                    teamId    = configuracionMongo.TeamId;
                    channelId = configuracionMongo.ChannelId;
                }

                //urlPostNotificacionCanal = Constantes.UrlApiGraph + Constantes.EndPointNotificacionTeams + configuracion["teamId"] + Constantes.EndPointNotificacionChannel + configuracion["channelId"] + Constantes.EndPointNotificacionMessages;
                urlPostNotificacionCanal = Constantes.UrlApiGraph + Constantes.EndPointNotificacionTeams + teamId + Constantes.EndPointNotificacionChannel + channelId + Constantes.EndPointNotificacionMessages;


                var responseMeeting = EnviarSolicitud(urlPostNotificacionCanal, jsonRequest, clientMeeting);

                return(ProcesarRespuestaNotificacionCanal(responseMeeting, linkMeeting));
            };
        }
Example #2
0
        public string ObtenerToken()
        {
            Dictionary <string, string> configuracion = new ConfiguracionService().ObtenerConfiguracion();


            var tenantId = configuracion["tenantId"];

            if (configuracion["config"] == "mongo")
            {
                var configuracionMongo = new MongoService().ObtenerConfiguracion();
                tenantId = configuracionMongo.TenantId;
            }

            var urlToken = Constantes.UrlToken + tenantId + Constantes.EndPointToken;

            return(GenerarToken(configuracion, urlToken));
        }