public Objects.LookupHlr ViewLookupHlr(long phonenumber, LookupHlrOptionalArguments optionalArguments = null) { var lookupHlr = new Resources.LookupHlr(new Objects.LookupHlr(phonenumber, optionalArguments)); var result = restClient.Retrieve(lookupHlr); return(result.Object as Objects.LookupHlr); }
const long PhoneNumber = 31612345678; // your phone number here. static void Main(string[] args) { IProxyConfigurationInjector proxyConfigurationInjector = null; // for no web proxies, or web proxies not requiring authentication //proxyConfigurationInjector = new InjectDefaultCredentialsForProxiedUris(); // for NTLM based web proxies //proxyConfigurationInjector = new InjectCredentialsForProxiedUris(new NetworkCredential("domain\\user", "password")); // for username/password based web proxies Client client = Client.CreateDefault(YourAccessKey, proxyConfigurationInjector); try { LookupHlrOptionalArguments optionalArguments = new LookupHlrOptionalArguments(); //optionalArguments.CountryCode = "NL"; // When using a national format, make sure a country code is also sent LookupHlr LookupHlr = client.ViewLookupHlr(PhoneNumber, optionalArguments); Console.WriteLine("{0}", LookupHlr); } catch (ErrorException e) { // Either the request fails with error descriptions from the endpoint. if (e.HasErrors) { foreach (Error error in e.Errors) { Console.WriteLine("code: {0} description: '{1}' parameter: '{2}'", error.Code, error.Description, error.Parameter); } } // or fails without error information from the endpoint, in which case the reason contains a 'best effort' description. if (e.HasReason) { Console.WriteLine(e.Reason); } } Console.WriteLine("Press any key to continue..."); Console.ReadKey(); }
public Objects.LookupHlr RequestLookupHlr(long phonenumber, string reference, LookupHlrOptionalArguments optionalArguments = null) { ParameterValidator.IsNotNullOrWhiteSpace(reference, "reference"); var lookupHlr = new Resources.LookupHlr(new Objects.LookupHlr(phonenumber, reference, optionalArguments)); var result = restClient.Create(lookupHlr); return(result.Object as Objects.LookupHlr); }