0

我通过了具有权限的经典 oAuth 流程Calendars.ReadWriteoffline_access,这应该足以创建订阅。

现在我得到了用户的日历列表(通过 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.

我在这里做错了什么?

4

1 回答 1

0

错误在于请求网址:POST /v1.0/me/subscriptions实际上应该是POST /v1.0/subscriptions(没有我)

于 2019-08-14T07:46:45.127 回答