0

I need to access and update Custom Fields of some of the Contacts in my Google Contacts via the API (v3). I just learned (in this question) that Extended Properties are not the same than Custom Fields. Now my question is, how can I access and change Custom Fields programmatically? This question posts a solution for Python but I am using Ruby and there is no Contacts API Client for Ruby.

When retrieving a (full) contact via

full_contact = authorization_handler.fetch_protected_resource(
    :uri => 'https://www.google.com/m8/feeds/contacts/default/full/1ecdsfslkf',
    :header => 'GData-Version: 3.0').body 

I get this response

{"entry"=>
  {"xmlns"=>"http://www.w3.org/2005/Atom", "xmlns:batch"=>"http://schemas.google.com/gdata/batch", "xmlns:gContact"=>"http://schemas.google.com/contact/2008", "xmlns:gd"=>"http://schemas.google.com/g/2005", "id"=>"http://www.google.com/m8/feeds/contacts/abc%40gmail.com/base/1easdc3", "updated"=>"2015-07-21T11:17:39.927Z", "category"=>    
    {"scheme"=>"http://schemas.google.com/g/2005#kind", "term"=>"http://schemas.google.com/contact/2008#contact"}, 
     "title"=>"Eli Int", "content"=>"Designer Graphique\nDivers clients\n", "link"=>
       [{"rel"=>"http://schemas.google.com/contacts/2008/rel#edit-photo", "type"=>"image/*", "href"=>"https://www.google.com/m8/feeds/photos/media/abc%40gmail.com/1eaddbbdc3/FfkSY8puj9sads9g"}, 
        {"rel"=>"http://schemas.google.com/contacts/2008/rel#photo", "type"=>"image/*", "href"=>"https://www.google.com/m8/feeds/photos/media/abc%40gmail.com/1ec3wff0dcbbdc3"}, 
        {"rel"=>"self", "type"=>"application/atom+xml", "href"=>"https://www.google.com/m8/feeds/contacts/abc%40gmail.com/full/1ecwffdcbbdc3"}, 
        {"rel"=>"edit", "type"=>"application/atom+xml", "href"=>"https://www.google.com/m8/feeds/contacts/abc%40gmail.com/full/1edcweffbbdc3/1437477459927001"}], 
     "organization"=>     
        {"rel"=>"http://schemas.google.com/g/2005#other", "orgName"=>"asds clients", "orgTitle"=>"Designer Graphique"}, 
     "email"=>
       {"rel"=>"http://schemas.google.com/g/2005#work", "address"=>"el@gmail.com", "primary"=>"true"}, 
     "groupMembershipInfo"=>
       [{"deleted"=>"false", "href"=>"http://www.google.com/m8/feeds/groups/abc%40gmail.com/base/171e0f878da9f342"}, 
        {"deleted"=>"false", "href"=>"http://www.google.com/m8/feeds/groups/abc%40gmail.com/base/538dd3c09eb63c1"}], "extendedProperty"=>
          {"name"=>"tag:fullcontact.com,2013:contact/extended#X-FC-ID-de8asdasd", "value"=>"4fbbcc1f5a517asdasdas48f778_goog"}}}

.. for the contact on whose Google Contacts web page I can see this:

google_contacts_screenshot

There is no sign of either the LinkedIn or Insight.ly Link custom field in the response. This leads me to the question: Is it possible to do what I want to do in Ruby?

Community
  • 1
  • 1
Flip
  • 6,233
  • 7
  • 46
  • 75
  • I am not sure about ruby client. But I tried to create custom field by adding this line in the xml which I am trying to create a contact. – SGC Oct 01 '15 at 20:53
  • This could work for creating a contact, but what about reading data from existing userDefinedFields ? What worries me, is that I don't see the UserDefined fields in the data I get for a contact. – Flip Oct 05 '15 at 09:37

0 Answers0