2

我在获取谷歌联系方式方面需要username帮助email,,,picture。此代码在获取电子邮件时工作正常:

var config = {
  'client_id': 'XXXXXXXXXXXX.apps.googleusercontent.com',
  //'scope': 'https://www.googleapis.com/auth/urlshortener',
  'scope': 'https://www.google.com/m8/feeds'
};

gapi.auth.authorize(config, function () {
  var authParams = gapi.auth.getToken(); // from Google oAuth
  authParams.alt = 'json';
  $.ajax({
    url: 'https://www.google.com/m8/feeds/contacts/default/full',
    dataType: 'jsonp',
    data: authParams,
    success: function (data) {
      alert(JSON.stringify(data))
    }
  });
});

此数据仅显示用户电子邮件地址,但我还想要用户名和个人资料图片。

这可能吗?请帮我。

4

0 回答 0