2

Google Contact API を使用して、連絡先とグループを Google Apps (gmail) に追加しています。連絡先とグループを作成できます。

しかし今、私はしたい:

  1. 連絡先の作成時に連絡先を特定のグループに入れます。
4

2 に答える 2

2
/* 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 */
于 2010-03-25T22:46:48.683 に答える
0

以下は私のために働いた:

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 });
于 2013-01-09T06:48:18.657 に答える