I can do a CRUD with a contact or a group, but I can't figure out how to add a contact to a specific group.
Someone can help me?
I can do a CRUD with a contact or a group, but I can't figure out how to add a contact to a specific group.
Someone can help me?
def get_group_id(label_name):
feed = gd_client.GetGroups()
for entry in feed.entry:
if entry.title.text.lower() == label_name:
return entry.id.text
contact_entry = gdata.contacts.data.ContactEntry() #contact_entry
group = get_group_id(label_name) #group id
membership = gdata.contacts.data.GroupMembershipInfo(href=group) #group membership
contact_entry.group_membership_info.append(membership) # adding group membership to contact_entry