本文介绍了带有 Google JavaScript 客户端库的 Google Contacts API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Google Contacts API v3.

由于 OAuth2 身份验证和授权,我开始使用 用于 JavaScript 的 Google API 客户端库.我对 API 访问的那部分没有问题.

Because of the OAuth2 authentication and authorization I'm started with the Google APIs Client Library for JavaScript.I have no problems with that part of the API access.

但是在完成身份验证部分之后,我不知道下一步该做什么.我可以将 google-api-javascript-client 用于 Google Contacts API v3 吗?在 javascript-client 支持的 Google API 列表中,没有出现联系人 API.但我可以完全访问 OAuth 2.0 Playground 工具.

But after doing the auth part I don't know what to do next. Can I use the google-api-javascript-client for the Google Contacts API v3? In the list of the supported Google APIs by the javascript-client the contacts API does not appear. But I have full access with the OAuth 2.0 Playground tool.

我真的很困惑哪个客户端最适合使用最新的 Google Contacts API.gdata-javascript-client 怎么样?

I am really confused which client is working best with the latest Google Contacts API. What is about the gdata-javascript-client?

推荐答案

要将 v3 联系人 api 与由 gapi(Google JS 客户端库)提供的身份验证令牌一起使用,这个很有帮助,使用 alt=&json

To use the v3 contacts api with the authentication token provided by gapi (Google JS client lib) this one is helpful, using alt=&json

$.getJSON('https://www.google.com/m8/feeds/contacts/default/full/?access_token=' +
             authResult.access_token + "&alt=json&callback=?", function(result){
      console.log(JSON.stringify(result));
});

这篇关于带有 Google JavaScript 客户端库的 Google Contacts API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 08:51