如何将以下查询放入Google Mail API

时间:2015-04-06 10:19:50

标签: rest google-api gmail-api postman jsonresponse

我通过POSTMAN执行了一些请求,但我总是收到此错误:

 {
  "error": {
    "code": 404, 
    "message": "Not Found", 
    "errors": [
      {
        "domain": "global", 
        "message": "Not Found", 
        "reason": "notFound"
      }
    ]
   }
 }

这些是我通过POSTMAN发送的请求。请告诉我如何运行这些。

https://www.googleapis.com/gmail/v1/users/me/drafts/{id}
https://www.googleapis.com/gmail/v1/users/{userId}/history
https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}
https://www.googleapis.com/gmail/v1/users/{userId}/messages/import

1 个答案:

答案 0 :(得分:0)

您可能错过了Authorization标题。

尝试使用标头https://www.googleapis.com/gmail/v1/users/me/labels

Authorization: Bearer {YOUR_API_KEY}发出GET请求