static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            string phoneTypeVoip = "5";

            try
            {
                PhoneIdClient phoneIdClient = new PhoneIdClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = phoneIdClient.PhoneId(phoneNumber);

                if (telesignResponse.OK)
                {
                    if (telesignResponse.Json["phone_type"]["code"].ToString() == phoneTypeVoip)
                    {
                        Console.WriteLine(string.Format("Phone number {0} is a VOIP phone.", phoneNumber));
                    }
                    else
                    {
                        Console.WriteLine(string.Format("Phone number {0} is not a VOIP phone.", phoneNumber));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            string message     = "N'oubliez pas d'appeler votre mère pour son anniversaire demain.";
            string messageType = "ARN";

            Dictionary <string, string> parameters = new Dictionary <string, string>
            {
                { "voice", "f-FR-fr" }
            };

            try
            {
                VoiceClient voiceClient = new VoiceClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = voiceClient.Call(phoneNumber, message, messageType, parameters);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string language    = "fr-FR";
            string ttsMessage  = "Votre code de vérification Widgets 'n' More est $$CODE$$.";

            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("language", language);
            parameters.Add("tts_message", ttsMessage);

            try
            {
                VerifyClient verifyClient = new VerifyClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = verifyClient.Voice(phoneNumber, parameters);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #4
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            Dictionary <string, object> contact = new Dictionary <string, object>();

            contact.Add("contact", new Dictionary <string, object>());
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("addons", contact);
            try
            {
                PhoneIdClient phoneIdClient = new PhoneIdClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = phoneIdClient.PhoneId(phoneNumber, parameters);

                if (telesignResponse.OK)
                {
                    Console.WriteLine(telesignResponse.Json);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #5
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            string extraDigit           = "0";
            string incorrectPhoneNumber = string.Format("{0}{1}", phoneNumber, extraDigit);

            try
            {
                PhoneIdClient phoneIdClient = new PhoneIdClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = phoneIdClient.PhoneId(incorrectPhoneNumber);

                if (telesignResponse.OK)
                {
                    Console.WriteLine(string.Format("Cleansed phone number has country code {0} and phone number is {1}.",
                                                    telesignResponse.Json["numbering"]["cleansing"]["call"]["country_code"],
                                                    telesignResponse.Json["numbering"]["cleansing"]["call"]["phone_number"]));

                    Console.WriteLine(string.Format("Original phone number was {0}.",
                                                    telesignResponse.Json["numbering"]["original"]["complete_phone_number"]));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #6
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string externalId = "external_id";

            try
            {
                AppVerifyClient             appVerifyClient  = new AppVerifyClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = appVerifyClient.Status(externalId);

                if (telesignResponse.OK)
                {
                    Console.WriteLine(string.Format("AppVerify transaction with external_id {0} has status code {1} and status description {2}.",
                                                    externalId,
                                                    telesignResponse.Json["status"]["code"],
                                                    telesignResponse.Json["status"]["description"]));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
        public string sendCalltoPhoneTel(string Message, string Mobile)
        {
            string customerId = "F246C360-8CFD-443D-9227-D30134043B75";
            string apiKey     = "BdcTq1dXhaCnhKENlxEXzhYWm8B1Du/0bYDXMR8Ex+7Q3M9fMkFXQXiLzC6EdFovA7yIg7MYxigCj0UkkkpZwg==";

            string phoneNumber = "919629987977";

            string verifyCode  = "12345";
            string message     = string.Format("Hello, your code is {0}. Once again, your code is {1}. Goodbye.", verifyCode, verifyCode);
            string messageType = "OTP";

            try
            {
                VoiceClient voiceClient = new VoiceClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = voiceClient.Call(phoneNumber, message, messageType);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            //Console.WriteLine("Press any key to quit.");
            //Console.ReadKey();
            return("");
        }
Пример #8
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string verifyCode  = "12345";
            string ttsMessage  = string.Format("Hello, your code is {0}. Once again, your code is {1}. Goodbye.", verifyCode, verifyCode);

            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("tts_message", ttsMessage);

            try
            {
                VerifyClient verifyClient = new VerifyClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = verifyClient.Voice(phoneNumber, parameters);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #9
0
        protected void Timer1_Tick(object sender, EventArgs e)
        {
            DateTime current = DateTime.Now;

            dayOfWeek = current.DayOfWeek.ToString();
            hour      = current.Hour.ToString();
            minute    = current.Minute.ToString();
            second    = current.Second.ToString();

            now.InnerText = dayOfWeek + " " + hour + ":" + minute + ":" + second;

            try
            {
                if (dayOfWeek.ToLower() == "thursday")
                {
                    if (hour == "15" && minute == "30")
                    {
                        if (canSendText)
                        {
                            MessagingClient             messagingClient  = new MessagingClient(customerId, apiKey);
                            RestClient.TelesignResponse telesignResponse = messagingClient.Message(phoneNumber, message, messageType);

                            canSendText = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Пример #10
0
        public static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string ucid        = "BACF";

            try
            {
                PhoneIdClient phoneIdClient = new PhoneIdClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = phoneIdClient.Score(phoneNumber, ucid);

                if (telesignResponse.OK)
                {
                    Console.WriteLine(string.Format("Phone number {0} has a '{1}' risk level and the recommendation is to '{2}' the transaction.",
                                                    phoneNumber,
                                                    telesignResponse.Json["risk"]["level"],
                                                    telesignResponse.Json["risk"]["recommendation"]));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #11
0
        public static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string verifyCode  = "12345";

            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("verify_code", verifyCode);

            try
            {
                VerifyClient verifyClient = new VerifyClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = verifyClient.Sms(phoneNumber, parameters);

                string referenceId = telesignResponse.Json["reference_id"].ToString();

                Console.WriteLine("Please enter your verification code:");
                string code = Console.ReadLine().Trim();

                if (verifyCode == code)
                {
                    Console.WriteLine("Your code is correct.");

                    telesignResponse = verifyClient.Completion(referenceId);

                    if (telesignResponse.OK && telesignResponse.Json["status"]["code"].ToString() == "1900")
                    {
                        Console.WriteLine("Completion successfully reported.");
                    }
                    else
                    {
                        Console.WriteLine("Error reporting completion.");
                    }
                }
                else
                {
                    Console.WriteLine("Your code is incorrect.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #12
0
        public static void SendSMS(string phoneNumber, string content)
        {
            string customerId = "A7B64D9C-9375-433A-87FE-90454D6F2429";
            string apiKey     = "sDfY84uHPfzViXCLXejqkuP0uAzlUKrC1DbwKoNYrBXj6qmzb/WOxvyO1xjGtfnJA9YOzaa9ZTSZeKz2pTzhMA==";

            string message     = content;
            string messageType = "ARN";

            try
            {
                MessagingClient             messagingClient  = new MessagingClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = messagingClient.Message(phoneNumber, message, messageType);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #13
0
        public static void SendTeleSignSMS(string templateName, UserLogin user, Book book, Reservation reserve)
        {
            string filePath        = @"C:\Users\@dm1n\Desktop\GitRepository\API\API\API\Content\templates\ReserveACopy.txt";
            string templateContent = File.ReadAllText(filePath);
            string customerId      = "A7B64D9C-9375-433A-87FE-90454D6F2429";
            string apiKey          = "sDfY84uHPfzViXCLXejqkuP0uAzlUKrC1DbwKoNYrBXj6qmzb/WOxvyO1xjGtfnJA9YOzaa9ZTSZeKz2pTzhMA==";

            templateContent = Notification.TemplateParser(templateContent, user, book, reserve);


            string message     = templateContent;
            string messageType = "ARN";

            try
            {
                MessagingClient             messagingClient  = new MessagingClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = messagingClient.Message(user.PhoneNumber, message, messageType);
            }
            catch (Exception e)
            {
            }
        }
Пример #14
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            string message     = "You're scheduled for a dentist appointment at 2:30PM.";
            string messageType = "ARN";

            try
            {
                MessagingClient             messagingClient  = new MessagingClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = messagingClient.Message(phoneNumber, message, messageType);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #15
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string verifyCode  = "12345";

            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("verify_code", verifyCode);

            try
            {
                VerifyClient verifyClient = new VerifyClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = verifyClient.Voice(phoneNumber, parameters);

                Console.WriteLine("Please enter your verification code:");
                string code = Console.ReadLine().Trim();

                if (verifyCode == code)
                {
                    Console.WriteLine("Your code is correct.");
                }
                else
                {
                    Console.WriteLine("Your code is incorrect.");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #16
0
        static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";

            string verifyCode  = "12345";
            string message     = string.Format("Your code is {0}", verifyCode);
            string messageType = "OTP";

            try
            {
                MessagingClient             messagingClient  = new MessagingClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = messagingClient.Message(phoneNumber, message, messageType);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
Пример #17
0
        public static void Main(string[] args)
        {
            string customerId = "FFFFFFFF-EEEE-DDDD-1234-AB1234567890";
            string apiKey     = "EXAMPLETE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==";

            string phoneNumber = "phone_number";
            string ucid        = "ATCK";

            try
            {
                PhoneIdClient phoneIdClient = new PhoneIdClient(customerId, apiKey);
                RestClient.TelesignResponse telesignResponse = phoneIdClient.NumberDeactivation(phoneNumber, ucid);

                if (telesignResponse.OK)
                {
                    if (telesignResponse.Json["number_deactivation"]["last_deactivated"].Type != JTokenType.Null)
                    {
                        Console.WriteLine(string.Format("Phone number {0} was last deactivated {1}.",
                                                        telesignResponse.Json["number_deactivation"]["number"],
                                                        telesignResponse.Json["number_deactivation"]["last_deactivated"]));
                    }
                    else
                    {
                        Console.WriteLine(string.Format("Phone number {0} has not been deactivated.",
                                                        telesignResponse.Json["number_deactivation"]["number"]));
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }