Hello, Please see my answers inline:
On Fri, Sep 2, 2011 at 5:04 PM, Justin Giesbrecht <[email protected]>wrote: > Hello, > I am using PHP + Zend to gain access to Gmail's Contacts. > I am able to retrieve everything just well... I am able to add and > update contacts as well. > > The problem i'm having is when I try to receive contacts to find out > which were 'deleted' from Gmail. > > And According to this > > http://code.google.com/googleapps/domain/shared_contacts/gdata_shared_contacts_api_reference.html#retrieving_with_query > > With the HINT: > *** Hint: To track incremental changes to a domain shared contact > list, do the following: When you send a request for a feed, keep track > of the value of the feed's <updated> element. Then you can later > retrieve only the domain shared contacts that have changed since the > previous request by setting the query parameter updated-min to that > <updated> value, and setting showdeleted to true. *** > > Here is a small version of my code: > $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/ > default/full'); > You are not requesting the Domain Shared Contacts feed but the current user's contacts. Also, please use SSL (https) over non-SSL (http) whenever possible. > $query->maxResults = $maxResults; > > if($updatedMin != NULL) { > $query->setParam('updated-min', $updatedMin); > $query->setParam('showdeleted', 'true'); > $query->setParam('requirealldeleted', 'true'); > $query->setParam('orderby', 'lastmodified'); > > And when I ADD a contact in Gmail, and then DELETE it in Gmail, it > will show up under the > $xml = simplexml_load_string($entry->getXML()); > $obj = new stdClass; > > $obj->gmailUrl = rawurlencode($entry->id); > *** This will show, DELETED = TRUE > $obj->delete = (string) $xml->groupMembershipInfo['deleted']; > > The "deleted" attribute under gContact:groupMembershipInfo is to tell client applications that the specified groupMembershipInfo has been removed for the contact (e.g the contact does not belong to the group anymore). > > But when I add a contact using the POST XML version, and the contact > then goes into "Other Contacts"... > By default, when creating a contact without any gContact:groupMembershipInfo element, the contact will be added into the "Other Contacts" group (which groups all the contacts). To add a contact to the "My Contacts" group, you will first have to query the Contact Groups feed to retrieve the atom ID of the "My Contacts" group and add a gContact:groupMembershipInfo element to the contact to be created. > If I then go and DELETE that contact I just added INSIDE gmail, > $obj->delete = (string) $xml->groupMembershipInfo['deleted']; > WILL == NULL > > And then even if I go and MOVE that contact to MY CONTACTS and make an > UPDATE to the contact, and show the DELETE... it will show up... > > Not sure I understand what you mean here. If you want to delete a contact, simply send a DELETE request to the contact's edit link. Best, Alain Is there any other method, or am I stuck big time? > Any help on trying to retrieve information on deleted contacts would > be great!! > Thank you in advance! > > -- > You received this message because you are subscribed to the Google > Groups "Google Contacts, Shared Contacts and User Profiles APIs" 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://code.google.com/apis/contacts/community/forum.html > -- Alain Vongsouvanh -- You received this message because you are subscribed to the Google Groups "Google Contacts, Shared Contacts and User Profiles APIs" 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://code.google.com/apis/contacts/community/forum.html
