使用Google联系API以编程方式向Google通讯录添加“新自定义字段”

时间:2010-03-25 11:47:13

标签: c# api gmail contact

如何使用Google Contact API(c#)创建新的“自定义字段到Google联系人”?

我用过:

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

感谢名单

1 个答案:

答案 0 :(得分:2)

查看ContactEntry课程以及如何update it

检索您的联系人:

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");

更新您的联系人:

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