My platform is Asp.net. I am new in Google Data API (GData). I am using this code to add a new contact to an existing group.

    public Contact AddContactToGoolgeGroup(GoogleContactsGroup group, Contact googleContact)
    {
        googleContact.GroupMembership.Add(new GroupMembership { HRef = group.GoogleContactGroupId });

        var feedUri = new Uri(ContactsQuery.CreateContactsUri("default"));

        return _contactsRequest.Insert(feedUri, googleContact);
    }

this code work's fine to add a new contact.

But i want to add an existing contact to multiple groups or a single group. How i do that. I used this code but not working.

googleContact.GroupMembership.Add(new GroupMembership { HRef = group.GoogleContactGroupId });
_contactsRequest.Update(googleContact);

Thanks.

Related posts

Recent Viewed