Google api 冲突409使用API创建Google共享联系人时出错

Google api 冲突409使用API创建Google共享联系人时出错,google-api,google-shared-contacts,Google Api,Google Shared Contacts,在尝试使用API添加新的Google共享联系人时,我不断收到HTTP 409“冲突”错误 我已尽可能密切地关注文档,并将新条目定义为: <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:

在尝试使用API添加新的Google共享联系人时,我不断收到HTTP 409“冲突”错误

我已尽可能密切地关注文档,并将新条目定义为:

<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>Test</gd:givenName>
    <gd:familyName>Testerson</gd:familyName>
    <gd:fullName>Test Testerson</gd:fullName>
  </gd:name>
  <atom:content type='text'></atom:content>
  <gd:email rel='http://schemas.google.com/g/2005#work' primary='true' address='test.testerson@sample.com.au' displayName='' />
  <gd:email rel='http://schemas.google.com/g/2005#home' address='' />
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(07) 33331111</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>0411223344</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#fax'>(07) 33331122</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'></gd:phoneNumber>
  <gd:im address='' 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>Abbey</gd:city>
    <gd:street>PO Box 4561</gd:street>
    <gd:region>WA</gd:region>
    <gd:postcode>6280</gd:postcode>
    <gd:country>Australia</gd:country>
    <gd:formattedAddress>PO Box 4561, Abbey, WA, 6280, Australia</gd:formattedAddress>
  </gd:structuredPostalAddress>
  <gd:structuredPostalAddress rel='http://schemas.google.com/g/2005#other'>
    <gd:city>Abbey</gd:city>
    <gd:street>47 Example Avenue</gd:street>
    <gd:region>WA</gd:region>
    <gd:postcode>6280</gd:postcode>
    <gd:country>Australia</gd:country>
    <gd:formattedAddress>47 Example Avenue, Abbey, WA, 6280, Australia</gd:formattedAddress>
  </gd:structuredPostalAddress>
  <gd:organization rel='http://schemas.google.com/g/2005#other'>
    <gd:orgTitle>Guinea Pig</gd:orgTitle>
    <gd:orgName>Test Org</gd:orgName>
  </gd:organization>
</atom:entry>
在本例中,CS_FEED_默认值是共享联系人URL,lsOut是上面定义的我的条目

发送此请求后,我得到409响应和以下响应文本:

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005'>
  <id>http://www.google.com/m8/feeds/contacts/test.com.au/base/47e904e10dd27dd2</id>
  <updated>2014-09-17T02:08:39.761Z</updated>
  <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/>
  <title type='text'></title>
  <content type='text'></content>
  <link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/test.com.au/47e904e10dd27dd2/1B2M2Y8AsgTpgAmY7PhCfg'/>
  <link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/test.com.au/full/47e904e10dd27dd2'/>
  <link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/test.com.au/full/47e904e10dd27dd2/1410919719761001'/>
  <gd:email rel='http://schemas.google.com/g/2005#work' address='test.testerson@sample.com.au' primary='true'/>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(07) 33331111</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>0411223344</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work_fax'>(07) 33331122</gd:phoneNumber>
</entry>

http://www.google.com/m8/feeds/contacts/test.com.au/base/47e904e10dd27dd2
2014-09-17T02:08:39.761Z
(07) 33331111
0411223344
(07) 33331122
有人能就这个问题给我提些建议吗

谢谢。

根据“当不同联系人使用相同的电子邮件地址时,可能会返回409错误。目前,谷歌联系人API不允许两个不同的联系人共享一个电子邮件地址”


您是否尝试过两次添加相同的电子邮件地址

我也有同样的错误,因为我忘了在GCP上启动我以前停止的SQL实例。

电子邮件地址绝对是唯一的,不存在。进一步挖掘后,我发现你的观点是正确的……之前已使用该电子邮件地址添加了联系人。我之前无法解决这个问题的原因是,在Flashpanel中对共享联系人的可视搜索中,新创建的联系人不可见。谢谢
<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005'>
  <id>http://www.google.com/m8/feeds/contacts/test.com.au/base/47e904e10dd27dd2</id>
  <updated>2014-09-17T02:08:39.761Z</updated>
  <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/>
  <title type='text'></title>
  <content type='text'></content>
  <link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/test.com.au/47e904e10dd27dd2/1B2M2Y8AsgTpgAmY7PhCfg'/>
  <link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/test.com.au/full/47e904e10dd27dd2'/>
  <link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/test.com.au/full/47e904e10dd27dd2/1410919719761001'/>
  <gd:email rel='http://schemas.google.com/g/2005#work' address='test.testerson@sample.com.au' primary='true'/>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(07) 33331111</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>0411223344</gd:phoneNumber>
  <gd:phoneNumber rel='http://schemas.google.com/g/2005#work_fax'>(07) 33331122</gd:phoneNumber>
</entry>