我尝试通过 JavaScript 使用 Google Calendar API,并在使用以下代码时不断收到 401 错误响应:
$.ajax({
dataType: "json",
url: "https://www.googleapis.com/calendar/v3/users/me/calendarList/<calendarID>?key=<my api key>",
success: function(result){
$('#result').html(result);
}
});
我的API使用有问题吗?我应该如何使用oAuth
?我已经有一个clientID
and secretID
从谷歌控制台但不知道如何使用它们。
Thanks.
这是经过大量研究后的答案,我刚刚找到并使用了本指南来使用 google calendar apihttp://googleappsdeveloper.blogspot.com/2011/12/using-new-js-library-to-unlock-power-of.html http://googleappsdeveloper.blogspot.com/2011/12/using-new-js-library-to-unlock-power-of.html
然后我仍然很困惑,因为每次我尝试重新生成几次 api 密钥都不起作用。然后我必须使用没有任何引荐来源网址的浏览器密钥,如下所述:出现错误 403:未配置访问。请使用 Google Developers Console 为您的项目激活 API https://stackoverflow.com/questions/22870082/getting-error-403-access-not-configured-please-use-google-developers-console-t
最后我一切正常。
这也是理解 OAuth2 的主要文章https://developers.google.com/accounts/docs/OAuth2 https://developers.google.com/accounts/docs/OAuth2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)