Julian,
    Thank you for very helpful posts and for including support
Contacts API v3 in python.

I have a question about support for Photo in latest version of
gdata-2.0.4 which has support for Contacts API v3.

I am trying to add photo for Shared Contacts via the API. I am using
ChangePhoto method as given in Developer Guide:
http://code.google.com/apis/contacts/docs/1.0/developers_guide_python.html#adding_photo

I get an error that 'Nonetype' attribute has no href. I looked deeper
to find that the contact did not have rel type of edit-photo. It just
has rel type of photo.

I looked further:
The first few lines of this ChangePhoto method are:

if isinstance(contact_entry_or_url, gdata.contacts.ContactEntry):
      url = contact_entry_or_url.GetPhotoEditLink().href
    else:
      url = contact_entry_or_url

So it seems it is trying to get edit link for photo.

In GetPhotoEditLink() is

def GetPhotoEditLink(self):
    for a_link in self.link:
      if a_link.rel == PHOTO_EDIT_LINK_REL:
        return a_link
    return None

So we are comparing rel with Photo_Edit_Rel ('http://
schemas.google.com/contacts/2008/rel#edit-photo')

Looping through all link.rel, the Contact does not seem to have
rel#edit-photo type. I believe it was present in v1 and not there in
v3 as seen from Protocol developer guides for v1 and v3:
http://code.google.com/apis/contacts/docs/1.0/developers_guide_protocol.html#photo_management
http://code.google.com/apis/contacts/docs/3.0/developers_guide_protocol.html#photo_management

I did try to use rel#photo url - I was able to save the changes and
GetPhoto method gives me the picture back but it has been 36hrs but
Photo is not visible in Contact once I search for the same in Contact
Manager UI (neither in Contacts tab search for that contact).

Any help is highly appreciated.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to