Google api 谷歌联系API v3-Can';创建联系人时不创建姓名/职务

Google api 谷歌联系API v3-Can';创建联系人时不创建姓名/职务,google-api,google-shared-contacts,Google Api,Google Shared Contacts,我正在使用GoogleContactsAPIv3文档,OAuthPlayer2.0 我可以通过get请求提取所有联系人。我可以使用POST创建新联系人,但似乎无法填充姓名字段等。电子邮件和电话号码很好 我在Contacts API v3文档的请求正文中逐字使用了atom/xml,如下所示 <atom:entry xmlns:atom='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/200

我正在使用GoogleContactsAPIv3文档,OAuthPlayer2.0

我可以通过get请求提取所有联系人。我可以使用POST创建新联系人,但似乎无法填充姓名字段等。电子邮件和电话号码很好

我在Contacts API v3文档的请求正文中逐字使用了atom/xml,如下所示

    <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>Elizabeth</gd:givenName>
     <gd:familyName>Bennet</gd:familyName>
     <gd:fullName>Elizabeth Bennet</gd:fullName>
  </gd:name>
  <atom:content type='text'>Notes</atom:content>
  <gd:email rel='http://schemas.google.com/g/2005#work'
    primary='true'
    address='liz@gmail.com' displayName='E. Bennet'/>
  <gd:email rel='http://schemas.google.com/g/2005#home'
    address='liz@example.org'/>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work'
    primary='true'>
    (206)555-1212
  </gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>
    (206)555-1213
  </gd:phoneNumber>
  <gd:im address='liz@gmail.com'
    protocol='http://schemas.google.com/g/2005#GOOGLE_TALK'
    primary='true'
    rel='http://schemas.google.com/g/2005#home'/>
  <gd:structuredPostalAddress
      rel='http://schemas.google.com/g/2005#work'
      primary='true'>
    <gd:city>Mountain View</gd:city>
    <gd:street>1600 Amphitheatre Pkwy</gd:street>
    <gd:region>CA</gd:region>
    <gd:postcode>94043</gd:postcode>
    <gd:country>United States</gd:country>
    <gd:formattedAddress>
      1600 Amphitheatre Pkwy Mountain View
    </gd:formattedAddress>
  </gd:structuredPostalAddress>
</atom:entry>

伊丽莎白
班纳特
伊丽莎白·班纳特
笔记
(206)555-1212
(206)555-1213
山景
1600圆形剧场Pkwy
加利福尼亚州
94043
美国
1600圆形剧场Pkwy山景酒店

非常感谢您的帮助。

我也被这刺痛了。我忽略了将此HTTP头添加到请求中:

GData-Version: 3.0

在v3之前,指示名称的方式是
全名
,而不是
。但我想最好只添加标题。

是的,您必须将GData版本添加到HTTP请求标题:

[request setValue:@"3.0" forHTTPHeaderField:@"GData-Version"];

试过了。但对于
某些联系人,标题字段仍然为空。