carolinux / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 1 forks source link

Contacts : GetContact does not give the photo link, GetContacts does #521

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Use this code to retreive the contact corresponding to the id

entry = gd_client.GetContact(id)

There is no link regarding the photo in the entry, GetPhoto returns None.

Use this code instead :

for entry in gd_client.GetContacts().entry:
    if entry.id.text == id:
        break

The link of the photo is in the entry and you can get it using GetPhoto.

Maybe I'm doing something wrong, but I've looked in the gdata files and I 
haven't found a problem. Maybe it's in the APIs ?

It may be related to this issue : 
http://code.google.com/p/gdata-python-client/issues/detail?id=424&q=getcontact

Original issue reported on code.google.com by eliemel...@gmail.com on 8 Jun 2011 at 2:04

GoogleCodeExporter commented 9 years ago
Hello,

What version of the client library are you using? I just tried with the client 
library I have (checkout'ed from the repository) and it worked perfectly.

Doing "gd_client.GetPhoto(contact_entry)" or 
"contact_entry.GetPhotoLink().href" worked for me.

Can you try printing the content of "contact_entry.GetPhotoLink().href" or 
printing the content of the contact entry (XML data) by doing "print 
contact_entry.to_string(pretty_print=True)?

Thanks!
Alain

Original comment by ala...@google.com on 8 Jun 2011 at 4:18

GoogleCodeExporter commented 9 years ago
Hi,

I'm using the latest version from the repo too.

Here is the output with GetContact :

http://pastebin.com/s62uWDk1

And the one with GetContacts :

http://pastebin.com/K24YMndP

Am I doing something wrong ?

Original comment by eliemel...@gmail.com on 9 Jun 2011 at 7:22

GoogleCodeExporter commented 9 years ago
Hello,

What is the parameter that you pass in the 
"gd_client.GetContact(<CONTACT_EDIT_LINK>)"? Please be aware that the parameter 
should be the contact's edit or self link and not the contact's Atom Id:
  * Contact's Atom ID: http://www.google.com/m8/feeds/contacts/dev%40korij.com/base/3bd3476c0db099cd
  * Contact's Edit Link: https://www.google.com/m8/feeds/contacts/dev%40korij.com/full/3bd3476c0db099cd

Please use the latter when retrieving a single contact.

Best,
Alain

Original comment by ala...@google.com on 9 Jun 2011 at 3:50

GoogleCodeExporter commented 9 years ago
Hi,

Thank you for your answer, you are right, I'm not using the good parameter...

Sorry about that.

Thanks for your help.

Original comment by eliemel...@gmail.com on 10 Jun 2011 at 9:38

GoogleCodeExporter commented 9 years ago

Original comment by ala...@google.com on 10 Jun 2011 at 3:44