javascript - Google Calendar API 权限不足

标签 javascript google-calendar-api

在进行 API 调用时,我在调用 Google 日历 API 时收到“权限不足”错误。请帮助我,我在这方面浪费了很多时间。访问 token 正在变得正确并且也经过了验证,但是当我进行 API 调用时它给我错误。

var scope='https://www.googleapis.com/auth/calendar';
    var TokenResp="ya29.1.AADtN_WFzHPhwPCU_UXnxcsDRfMfpKgACnPcJA74r8lmB1pQL22iOZUS_tofGA1TAw";
    $.ajax({
                url: "https://www.googleapis.com/oauth2/v1/userinfo?access_token=" + TokenResp,
                //data: { 'Authorization': 'Bearer ' + TokenResp },
                type: "GET",
                success: function (audata) {
                    //alert('Success!' + JSON.stringify(audata));
                }
            });

这是调用 API 的代码 https://developers.google.com/accounts/docs/OAuth2UserAgent .

最佳答案

从当前文件夹中删除之前的授权 key 文件'token.json'

关于javascript - Google Calendar API 权限不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20465022/

相关文章:

java - Google Calendar API (Java) - 创建 Google Calendar Event 时的时间格式无效

javascript - 实现警报 UI Web

javascript - 打开没有菜单栏的浏览器窗口(JavaScript?)

javascript - Angular.js - 表单验证会发出任何事件吗?

javascript - 类型错误 : "this..." is not a function

javascript - 为什么必须将其作为数组而不是字符串传入?

google-calendar-api - 是否可以在 Google 日历中使用搜索字符串 url

php - Google Calendar API php 客户端库的文档

javascript - 在 Javascript 中使用 Google Calendar API 插入方法创建新日历返回错误 400 "Missing title"

node.js - 使用 Nodejs 的服务帐户在 Google 日历中插入事件