【问题标题】:how to get gmail contacts with photo in php如何在php中获取带有照片的gmail联系人
【发布时间】:2014-06-21 09:00:28
【问题描述】:

嗨,我有一个代码可以用 php 获取 gmail 联系人。首先我获得会话令牌,然后转到该网址: https://www.google.com/m8/feeds/contacts/default/full?max-results='.$maxresults.'&oauth_token='。 $_SESSION['token']

所以我现在有一个联系人,但无法从联系人中获取图像。我有一个联系图片的链接:

<link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/xxxxxx%40gmail.com/2e" />

但是当我输入那个网址时,谷歌告诉我出了点问题,没有更多信息。您有什么解决方案或想法如何从 gmail 联系人列表中获取图像吗?

问候

【问题讨论】:

  • 我认为 URL 必须有 oauth_token,因为只有登录后才能访问它
  • 你指的是哪个网址?从你的问题看不清楚。也由谷歌告诉你有什么问题,你是指谷歌浏览器还是谷歌网站管理员。此外,“出了点问题”也不是充分的技术错误描述。

标签: php xml authentication gmail


【解决方案1】:

使用类似的东西(javascript)

function fetchGooglePhotosUrl(defaultEmail, contactId, token) {
    return "https://www.google.com/m8/feeds/photos/media/" + encodeURIComponent(defaultEmail) + "/" + contactId + "?access_token=" + token;
}

Source

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-14
    • 2018-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-12
    • 1970-01-01
    相关资源
    最近更新 更多