google联系人api不在google联系人中添加名称和地址 [英] google contacts api not adding name and address in google contact

查看:147
本文介绍了google联系人api不在google联系人中添加名称和地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在cakephp中通过curl发送xml,但只有电子邮件和电话号码正在添加

google联系人,其他字段都为空,我们可以获取正确的xml来添加google中的所有字段
联系人通过api
我们的xml代码:

we are sending xml through curl in cakephp, but only email and phone numbers are adding in
google contacts , other fields are blank,can we get proper xml to add all fields in google contacts through api our xml code:

 $xml = <<<'EOF'
 <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'/>

   <title type="text">TITLE</title>
  <gd:name>
 <gd:givenName>First</gd:givenName>
 <gd:additionalName>ADDITIONALNAME</gd:additionalName>
 <gd:familyName>Last</gd:familyName>
 <gd:namePrefix>NAMEPREFIX</gd:namePrefix>
 <gd:nameSuffix>NAMESUFFIX</gd:nameSuffix>
  </gd:name>
 <gd:structuredPostalAddress rel='http://schemas.google.com/g/2005#work' primary='true'>
 <gd:city>CITY</gd:city>
 <gd:street>STREET</gd:street>
 <gd:region>REGION</gd:region>
<gd:postcode>POSTCODE</gd:postcode>
<gd:country>COUNTRY</gd:country>
 </gd:structuredPostalAddress>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home' primary='true'>
  HOMEPHONENUMBER
</gd:phoneNumber>\
<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>MOBILENO</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work'>WORKPHONENO</gd:phoneNumber>
<gd:email label="home" address="EMAILADDRESS" displayName="DISPLAYNAME" />
</atom:entry>
EOF;


推荐答案

我们需要添加此标题 gdata-version:3.0 以及授权标头到post调用。
此答案已经此处

We need to add this header gdata-version: 3.0 along with the Authorization header to the post call. This answer is already here

这篇关于google联系人api不在google联系人中添加名称和地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆