Beispiel #1
0
        public NumberLookupRecord Get()
        {
            NumberLookupRecord        record  = new NumberLookupRecord();
            NumberLookupRecordOptions options = new NumberLookupRecordOptions
            {
                Type = "undefined"
            };

            Console.WriteLine(JsonConvert.SerializeObject(options));

            try
            {
                record = service.Get(phoneNumber, options);
                Console.WriteLine(JsonConvert.SerializeObject(record));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(record);
        }
Beispiel #2
0
        public async Task <NumberLookupRecord> GetAsync()
        {
            NumberLookupRecord        record  = new NumberLookupRecord();
            NumberLookupRecordOptions options = new NumberLookupRecordOptions
            {
                Type = "undefined"
            };

            Console.WriteLine(JsonConvert.SerializeObject(options));

            try
            {
                record = await service.GetAsync(phoneNumber, options, null, new CancellationToken());

                Console.WriteLine(JsonConvert.SerializeObject(record));
            }
            catch (TelnyxException ex)
            {
                Console.WriteLine("exception");
                Console.WriteLine(JsonConvert.SerializeObject(ex));
            }
            return(record);
        }