Oauth 2.0 请求具有无效的身份验证凭据-Google日历API

Oauth 2.0 请求具有无效的身份验证凭据-Google日历API,oauth-2.0,postman,google-calendar-api,google-oauth,Oauth 2.0,Postman,Google Calendar Api,Google Oauth,我正在尝试使用Postman向Google日历API发送请求。以下是谷歌文档: 我正在做一个: GET https://www.googleapis.com/calendar/v3/calendars/{my_calendar_id_here} 在Postman Authorization选项卡上,我指定要使用OAuth 2.0,并且我还放置了我的访问令牌(我使用它从代码中进行日历API调用,工作正常)。然而,邮递员的回应如下: { "error": { &

我正在尝试使用Postman向Google日历API发送请求。以下是谷歌文档:

我正在做一个:

GET  https://www.googleapis.com/calendar/v3/calendars/{my_calendar_id_here}
在Postman Authorization选项卡上,我指定要使用OAuth 2.0,并且我还放置了我的访问令牌(我使用它从代码中进行日历API调用,工作正常)。然而,邮递员的回应如下:

{
  "error": {
    "code": 401,
    "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "errors": [
      {
        "message": "Invalid Credentials",
        "domain": "global",
        "reason": "authError",
        "location": "Authorization",
        "locationType": "header"
      }
    ],
    "status": "UNAUTHENTICATED"
  }
} 

我真的不明白我做错了什么,而其他答案似乎并没有针对我的具体情况。如果有人能指出我做错了什么,我将不胜感激。

我建议在中复制请求。然后使用确认为工作访问令牌对邮递员进行故障排除

对于Postman,您还可以将访问令牌作为请求头传递,如果这样可以解决问题

邮差标题选项卡输入:

| Key           | Value                 |
|---------------|-----------------------|
| Authorization | Bearer {access_token} |