【问题标题】:Microsoft graph API - unauthorized error when subscribing to any calendarMicrosoft 图形 API - 订阅任何日历时出现未经授权的错误
【发布时间】:2019-08-14 15:46:45
【问题描述】:

我使用权限 Calendars.ReadWriteoffline_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.

我在这里做错了什么?

【问题讨论】:

    标签: microsoft-graph-api microsoft-graph-calendar


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多