我正在开发一个可以使用Google Calendar API进行操作的小型网站。我在这里发布了它:http://evansiroky.com/temp-gcal-question/tests/每当我尝试授权时,我使用的clientId似乎并不重要,它总是说它是经过授权的。此外,如果将immediate设置为true或false似乎并不重要。这是授权码:
gapi.auth.authorize({
client_id: clientId,
scope: ['https://www.googleapis.com/auth/calendar'],
immediate: immediate
}, function(authResult) {
if(authResult && !authResult.error) {
isAuthorized = true;
} else {
isAuthorized = false;
}
if(callback) {
var out = isAuthorized ? null : authResult;
callback(out);
}
});
但是,一旦我尝试列出日历的事件,我就会收到dailyLimitExceededUnreg错误。以下是列出事件的代码:
gapi.client.load('calendar', 'v3', function() {
var request = gapi.client.calendar.events.list(_.extend({
calendarId: 'primary',
orderBy: 'starttime',
singleEvents: true,
showDeleted: true,
}, options.data));
request.then(function(resp) {
options.success(resp);
}, function(reason) {
options.failure(reason);
});
});
以下是返回的错误:
{
"result": {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
},
"body": "{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"usageLimits\",\n \"reason\": \"dailyLimitExceededUnreg\",\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\",\n \"extendedHelp\": \"https://code.google.com/apis/console\"\n }\n ],\n \"code\": 403,\n \"message\": \"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.\"\n }\n}\n",
"headers": {
"date": "Fri, 02 Oct 2015 19:08:41 GMT",
"content-encoding": "gzip",
"server": "GSE",
"vary": "Origin, X-Origin",
"content-type": "application/json; charset=UTF-8",
"cache-control": "private, max-age=0",
"content-length": "215",
"expires": "Fri, 02 Oct 2015 19:08:41 GMT"
},
"status": 403,
"statusText": "OK"
}
我做错了什么?