Hello, First of all, I would advise you to use version 3.0 of the protocole as it provides more functionalities. A contact's name is stored in the <gd:name<http://code.google.com/apis/gdata/docs/2.0/elements.html#gdName>> element which contains several subelements such as <gd:familyName>, <gd:givenName>, ...
You can see an example here: http://code.google.com/apis/contacts/docs/3.0/developers_guide.html#contact_entry The reference guide can be found here: * gd namespace: http://code.google.com/apis/gdata/docs/2.0/elements.html#gdContactKind * gContact namespace: http://code.google.com/apis/contacts/docs/3.0/reference.html Best, Alain On Tue, Dec 27, 2011 at 1:51 AM, Alias <[email protected]> wrote: > Hi, > > I am using the following php code to import gmail contacts for a > particular login. > > > 1. $xml= new SimpleXMLElement($xmlresponse); > 2. $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/2005 > '); > 3. $result = $xml->xpath('//gd:email'); > 4. > 5. foreach ($result as $feed) { > 6. > 7. echo <http://www.php.net/echo> $feed->attributes()->displayName . > "<br>"; > 8. echo <http://www.php.net/echo> $feed->attributes()->address . > "<br><br>"; > 9. > 10. } > > I get all the contact addresses but the displayName is not returning > anything, I am not sure which version protocol version I am using (probably > it is 1.0) > Can someone help me to fetch the contact name in that scenario > (protocol1)? > > -- > Alias > > -- > 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 | Developer Programs Engineer -- 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
