开发者

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

开发者 https://www.devze.com 2022-12-25 02:34 出处:网络
How to create new \"Custom Field into Google Contact using Google Contact API (c#)? I used: ExtendedProperty obj_ExtendedProperty = new ExtendedProperty();

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


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/test@gmail.com/full/12345");

UPDATE your contact:

UserDefinedField customField= new UserDefinedField("yourFieldName","yourFieldValue);  
contact.addUserDefinedField(customField);  
Contact updatedContact = cr.Update(contact);
0

精彩评论

暂无评论...
验证码 换一张
取 消