Craig Lambie
asked on
Get Extended Property from Google Contact using .Net Library
Hi Experts,
I am using this code to retrieve a list of contacts from Google Contacts
And I can successfully look up a lot of info, but I have created a custom field in my address book, and want to retrieve it. I can't work out how to access the Extended Properties?
Any ideas?
I am using this code to retrieve a list of contacts from Google Contacts
public Feed<Contact> GetContacts()
{
//Provide Login Information
RequestSettings rsLoginInfo = new RequestSettings("", Constants.GoogleAc.Username, Constants.GoogleAc.Password);
rsLoginInfo.AutoPaging = true;
// Fetch contacts and dislay them in ListBox
cr = new ContactsRequest(rsLoginInfo);
Feed<Contact> feedContacts = cr.GetContacts();
return feedContacts;
} //GetContacts
And I can successfully look up a lot of info, but I have created a custom field in my address book, and want to retrieve it. I can't work out how to access the Extended Properties?
Any ideas?
foreach (Contact ct in cts.Entries)
{
ContactDetails Ctct = new ContactDetails();
Ctct.FirstName = ct.Name.GivenName;
Ctct.LastName = ct.Name.FamilyName;
Ctct.Email = ct.PrimaryEmail.Value;
Ctct.Mobile = ct.PrimaryPhonenumber.Value;
Ctct.TwitterName = ct.ExtendedProperties ***????
}
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Is the right answer.
Open in new window
http://code.google.com/apis/contacts/docs/2.0/reference.html#ProjectionsAndExtended
Now I would think the Google address book API is similar to the Google calendar API
Open in new window
http://code.google.com/apis/calendar/data/2.0/developers_guide_dotnet.html#ExtendedPropsTherefore it would be
Open in new window