Hey Julian, the code Andrew wrote above it was for removing a whole group, the code you said to remove all contacts from a group actually it didnt worked, it added a duplicate of the last contact instead and nothing was deleted.
Do you know what could be the problem? And also, how can i add phoneNumber and Notes to a contact when i add it to a group ?( Talking about PHP ) Gracias! On Apr 6, 3:58 pm, "Julian (Google)" <[email protected]> wrote: > You're welcome Andrew. > > Because other people asked about .NET, here is an example in C# (using > the latest library). This removes a user from group using a group ID: > > RequestSettings requestSettings = new RequestSettings("App-name", > "[email protected]", "PASSWORD"); > requestSettings.AutoPaging = true; > ContactsRequest contactsRequest = new ContactsRequest > (requestSettings); > Uri uri = new Uri("http://www.google.com/m8/feeds/contacts/user > %40domain.com/full/1"); // User's ID > Contact contact = contactsRequest.Retrieve<Contact>(uri); > > foreach (GroupMembership group in contact.GroupMembership){ > // Group's ID > if ( group.HRef.Equals( "http://www.google.com/m8/feeds/groups/user > %40domain.com/base/6" )) { > contact.GroupMembership.Remove( group ); > contactsRequest.Update<Contact>(contact); > break; > } > > } > > On Apr 4, 4:43 am, andyjimmy <[email protected]> wrote: > > > Worked a charm Julian. Thank you very much! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en -~----------~----~----~----~------~----~------~--~---
