Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically adding "New Custom Field" To Google Contacts using Google contact API

Tags:

c#

gmail

contacts

How to create new "Custom Field into Google Contact using Google Contact API (c#)?

I used:

ExtendedProperty obj_ExtendedProperty = new ExtendedProperty(); 
 obj_ExtendedProperty.Name             = "Department";
 obj_ExtendedProperty.Value            = "Sales";
 ContactEntry.ExtendedProperties.Add(obj_ExtendedProperty);

Thanx

like image 632
Preeti Avatar asked May 07 '26 23:05

Preeti


1 Answers

Have a look to ContactEntry class and how to update it.

RETRIEVE your contact:

RequestSettings rs = new RequestSettings(this.ApplicationName, this.userName,this.passWord);      
ContactsRequest cr = new ContactsRequest(rs);  
Contact contact = cr.Retrieve<Contact>("http://www.google.com/m8/feeds/contacts/[email protected]/full/12345");

UPDATE your contact:

UserDefinedField customField= new UserDefinedField("yourFieldName","yourFieldValue);  
contact.addUserDefinedField(customField);  
Contact updatedContact = cr.Update(contact);
like image 116
systempuntoout Avatar answered May 10 '26 12:05

systempuntoout



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!