Jia*_*ang 18 google-calendar-api
我从这里尝试了日历插入示例:https://developers.google.com/google-apps/calendar/v3/reference/events/insert#examples 无论我使用哪个属性,我总是得到404"未找到"错误.任何人都可以对此有所了解吗?非常感谢!!!
POST https://www.googleapis.com/calendar/v3/calendars/test/events?sendNotifications=false&fields=start&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZQaT3-Tj_bviwaY9Xi3gDspuBbCtEKtidnZkTXuWpI
X-JavaScript-User-Agent: Google APIs Explorer
{
"end": {
"date": "2012-07-11"
},
"start": {
"date": "2012-07-09"
}
}
Run Code Online (Sandbox Code Playgroud)
回复:404未找到
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
Run Code Online (Sandbox Code Playgroud)
Mat*_*aly 13
我相信它告诉你无法找到日历"测试"资源.你创建了一个名为"test"的日历吗?如果将"test"替换为"primary"(主日历),则Explorer应该可以正常工作.
Car*_*ori 10
今天我在非主日历上遇到了同样的问题。现在已经解决了,请按以下步骤操作:
注意:此解决方案为我提供带有服务帐户身份验证方法的 PHP Web 应用程序。您也必须使用服务帐户方法而不是OAuth 2.0。
小智 6
致 JuanPablo,关于非主要日历:
如果是非主日历,您必须使用id(以电子邮件地址的形式)作为calendarId。
示例:假设您有一个名为“test”的日历。你可以这样得到它的id
GET https://www.googleapis.com/calendar/v3/users/me/calendarList?key={YOUR_API_KEY}
->
{
"kind": "calendar#calendarList",
...
"items": [
{
"kind": "calendar#calendarListEntry",
"etag": ...,
"id": "123example123example123xxx@group.calendar.google.com",
"summary": "test",
"description": "Testing calendar for development of Calendar related applications",
...
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
您的帖子将如下所示
POST https://www.googleapis.com/calendar/v3/calendars/123example123example123xxx@group.calendar.google.com/events?sendNotifications=false&fields=start&key={YOUR_API_KEY}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17216 次 |
| 最近记录: |