/// <summary> /// Search for Specified Text, Show Specified Fields /// </summary> public void GetSpecifiedFieldsSearchText() { // Create the manager with the api key var route4Me = new Route4MeManager(ActualApiKey); CreateTestContacts(); var addressBookParameters = new AddressBookParameters { Query = "Test FirstName", Fields = "address_id,first_name,address_email,address_group,first_name,cached_lat,schedule", Offset = 0, Limit = 20 }; // Run the query var response = route4Me.SearchAddressBookLocation( addressBookParameters, out List <AddressBookContact> contactsFromObjects, out string errorString); PrintExampleContact( contactsFromObjects.ToArray(), (contactsFromObjects != null ? (uint)contactsFromObjects.Count : 0), errorString); RemoveTestContacts(); }
/// <summary> /// Search Locations By IDs /// </summary> public void SearchLocationsByIDs() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); AddressBookParameters addressBookParameters = new AddressBookParameters { AddressId = "2640129,4621569" }; // Run the query uint total = 0; string errorString = ""; AddressBookContact[] contacts = route4Me.GetAddressBookLocation(addressBookParameters, out total, out errorString); Console.WriteLine(""); if (contacts != null) { Console.WriteLine("SearchLocationsByIDs executed successfully, {0} contacts returned, total = {1}", contacts.Length, total); Console.WriteLine(""); } else { Console.WriteLine("SearchLocationsByIDs error: {0}", errorString); } }
/// <summary> /// Get Address Book Location /// </summary> public void GetAddressbookLocation() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); AddressBookParameters addressBookParameters = new AddressBookParameters { Query = "david", Offset = 0, Limit = 20 }; // Run the query uint total = 0; string errorString = ""; AddressBookContact[] contacts = route4Me.GetAddressBookLocation(addressBookParameters, out total, out errorString); Console.WriteLine(""); if (contacts != null) { Console.WriteLine("GetAddressbookLocation executed successfully, {0} contacts returned, total = {1}", contacts.Length, total); Console.WriteLine(""); } else { Console.WriteLine("GetAddressbookLocation error: {0}", errorString); } }
/// <summary> /// Search for Specified Text, Show Specified Fields /// </summary> public void GetSpecifiedFieldsSearchText() { // Create the manager with the api key Route4MeManager route4Me = new Route4MeManager(c_ApiKey); AddressBookParameters addressBookParameters = new AddressBookParameters { Query = "david", Fields = "first_name,address_email", Offset = 0, Limit = 20 }; // Run the query uint total = 0; string errorString = ""; List <string[]> contacts = route4Me.SearchAddressBookLocation(addressBookParameters, out total, out errorString); Console.WriteLine(""); if (contacts != null) { Console.WriteLine("GetSpecifiedFieldsSearchText executed successfully, {0} contacts returned, total = {1}", contacts.Count, total); Console.WriteLine(""); } else { Console.WriteLine("GetSpecifiedFieldsSearchText error: {0}", errorString); } }
/// <summary> /// Get the address book contacts /// </summary> public void GetAddressBookContacts() { // Create the manager with the api key var route4Me = new Route4MeManager(ActualApiKey); var addressBookParameters = new AddressBookParameters() { Limit = 10, Offset = 0 }; // Run the query AddressBookContact[] contacts = route4Me.GetAddressBookLocation( addressBookParameters, out uint total, out string errorString); PrintExampleContact(contacts, total, errorString); }
/// <summary> /// Search Locations By IDs /// </summary> public void SearchLocationsByIDs() { // Create the manager with the api key var route4Me = new Route4MeManager(ActualApiKey); CreateTestContacts(); var addressBookParameters = new AddressBookParameters { AddressId = contact1.address_id + "," + contact2.address_id }; // Run the query AddressBookContact[] contacts = route4Me.GetAddressBookLocation( addressBookParameters, out uint total, out string errorString); PrintExampleContact(contacts, total, errorString); RemoveTestContacts(); }