Google通讯录API - 即使在我的Google通讯录中,某些联系人的名字和姓氏也会丢失

时间:2017-03-22 13:02:36

标签: php google-contacts google-api-v3

有一些联系人谷歌联系人API没有返回名字和姓氏。

奇怪的是,当我访问我的谷歌联系人时它显示了名字和姓氏,但即使我从谷歌联系人屏幕导出联系人,某些联系人也缺少名字和姓氏。

屏幕截图1:我的谷歌联系人屏幕

enter image description here

屏幕截图2:导出的联系人CSV

enter image description here

API也是如此。对于联系人Jim Smith,API不会返回名字和姓氏。

enter image description here

我正在使用谷歌联系人API版本3.这是输出XML:

<entry gd:etag='"SH08eDVSLit7I2A9XRFRFkkOTwQ."'>
    <id>
        http://www.google.com/m8/feeds/contacts/topslivewire%40gmail.com/base/5f4ec6148922d762
    </id>
    <updated>
        2016-08-31T12:00:09.370Z
    </updated>
    <app:edited xmlns:app="http://www.w3.org/2007/app">
        2016-08-31T12:00:09.370Z
    </app:edited>
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact">
    </category>
    <title>
    </title>
    <link href="https://www.google.com/m8/feeds/photos/media/topslivewire%40gmail.com/5f4ec6148922d762?v=3.0" rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*"/>
    <link href="https://www.google.com/m8/feeds/contacts/topslivewire%40gmail.com/full/5f4ec6148922d762?v=3.0" rel="self" type="application/atom+xml"/>
    <link href="https://www.google.com/m8/feeds/contacts/topslivewire%40gmail.com/full/5f4ec6148922d762?v=3.0" rel="edit" type="application/atom+xml"/>
    <gd:email address="ami.bhatti@tops-int.com" primary="true" rel="http://schemas.google.com/g/2005#other">
    </gd:email>
</entry>

对于联系人Ami Bhatti,API不会返回名字和姓氏。

&#34;其他联系人&#34;

的排序问题

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

如果我在环聊中的用户搜索栏中输入ami.bhatti@tops-int.com,我可以看到&#34; Ami Bhatti&#34;弹出,这意味着名称来自个人资料,但您在那里的实际联系只有电子邮件本身。除了个人资料图片之外,Contacts API不会加入用户个人资料中的信息。

如果您想要手动输入的联系信息以外的个人资料信息,您可以考虑使用People API(尽管此时仅支持只读操作):https://developers.google.com/people/