我经历了具有权限Calendars.ReadWrite
和offline_access
的经典oAuth流,这足以创建预订。
现在,我获得了用户日历的列表(通过api),当我尝试通过这样的请求订阅来自任何这些日历的事件时:
POST /v1.0/me/subscriptions HTTP/1.1 Accept: */* Content-Type: application/json
{
"changeType": "created,deleted,updated",
"notificationURL": "https://...",
"resource": "/me/calendars/{id}/events",
"expirationDateTime": "2019-08-15T00:00Z",
"clientState": "..."
}
(甚至是"resource": ,"/me/events"
)
我得到答复:
401 - Unauthorized: Access is denied due to invalid credentials.
You do not have permission to view this directory or page using the credentials that you supplied.
我在这里做什么错了?
答案 0 :(得分:0)
错误在于请求网址内:POST /v1.0/me/subscriptions
实际上应该是POST /v1.0/subscriptions
(不带我)