2
我正在使用Google聯繫人API將聯繫人和羣組添加到Google Apps(gmail)。 我能夠創建聯繫人以及組。將聯繫人添加到特定組中? Google聯繫人API
但現在我想:
- 認沽接觸到特定的組在創建聯繫的時間。
我正在使用Google聯繫人API將聯繫人和羣組添加到Google Apps(gmail)。 我能夠創建聯繫人以及組。將聯繫人添加到特定組中? Google聯繫人API
但現在我想:
/* Get Group, this is covered in the Google Contact API documents */
/* http://code.google.com/apis/contacts/docs/2.0/developers_guide_dotnet.html#retrieving_single_group */
Group group = ...;
Contact newContact = new Contact();
var groupMembership = new GroupMembership();
groupMembership.HRef= group.Id;
newContact.Title = "My google contact title";
newContact.GroupMembership.Add(groupMembership);
/* Save the contact, also covered in the documents */
/* http://code.google.com/apis/contacts/docs/2.0/developers_guide_dotnet.html#Creating */
繼爲我工作:
Group g = cr.Retrieve<Group>(new Uri("https://www.google.com/m8/feeds/groups/liz%40gmail.com/base/68f415478ba1aa69"));
newEntry.GroupMembership.Add(new GroupMembership() { HRef = g.Id });