我正在尝试使用 JavaScript 插入日历:
var config = {
'client_id': client_id,
'scope': 'https://www.googleapis.com/auth/calendar'
}
gapi.auth.authorize(config, function() {
gapi.client.load('calendar', 'v3', function() {
var new_calendar = {
id: 'new_calendar'}
request = gapi.client.calendar.calendarList.insert(new_calendar )
requestr.execute(function(resp) {
if(!resp.error){
alert('Calendar inserted')
}
return true
})
return true
})
return true
})
)
授权成功后,我在插入请求上收到 404 错误
谢谢
最佳答案
确保您拥有正确的日历 ID 我认为“new_calendar”不是有效的日历 ID。此外,您似乎正在插入 calendarList不插入 new calendar正如你的问题所述。你想做什么?
日历和日历列表之间存在差异。该列表位于网站的左侧。如果您希望显示它,则需要在创建新日历后将其添加到日历列表中。
关于javascript - google apis v3 使用 javascript 添加新日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27962601/