Re: [Contacts API] HTTP POST New Contact, name doesn't comp

64 views
Skip to first unread message

Alain Vongsouvanh

unread,
Apr 11, 2012, 5:45:12 PM4/11/12
to google-co...@googlegroups.com
Hello,

Have you specified the "GData-Version: 3.0" request header along with your request? The structured name is only available from v2:

Best,
Alain

On Wed, Apr 11, 2012 at 2:05 AM, siriemy <andrea....@gmail.com> wrote:
Hello,
I'm trying to create a new gmail contact by request Httppost.
I create this body request:
 
 <atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>
   <atom:category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/>
   <gd:name>
      <gd:givenName>aaa</gd:givenName>
      <gd:familyName>ccc</gd:familyName>
      <gd:fullName>ccc</gd:fullName>
   </gd:name>
   <atom:content type='text'>Notes</atom:content>
   <gd:email rel='http://schemas.google.com/g/2005#work' primary='true' address='a...@gmail.com' displayName='E. Bennet'/>
   <gd:email rel='http://schemas.google.com/g/2005#home' address='aa...@example.org'/>
   <gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>1111</gd:phoneNumber>
   <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>2222</gd:phoneNumber>
   <gd:im address='c...@gmail.com' protocol='http://schemas.google.com/g/2005#GOOGLE_TALK' primary='true' rel='http://schemas.google.com/g/2005#home'/>
 </atom:entry>
 
The response is "Http/1.1 201 Created". If I go on gmail I see the new contact but the names are empty (givenName,familyName and fullname).
Is there something of wrong in my request ?
 
Thanks
Andrea
 

--
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
google-co...@googlegroups.com
To unsubscribe from this group, send email to
google-contacts...@googlegroups.com
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html



--
Alain Vongsouvanh | Developer Programs Engineer

siriemy

unread,
Apr 13, 2012, 9:14:34 AM4/13/12
to google-co...@googlegroups.com
Thanks Alan.
I use 'GData-Version: 3.0' and it works.
 
Thanks again.
Andrea
Alain


To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages