【问题标题】:Nodejs Gmail OAuth API to get Users.threads: listNodejs Gmail OAuth API获取Users.threads:列表
【发布时间】:2016-11-25 21:05:42
【问题描述】:

我想在特定日期时间后获取线程列表,但找不到任何方法。 根据上次使用 Gmail API 获取线程列表的时间,我已将更新的日期时间存储在数据库中。 然后使用更新的时间我想进一步检索列表。

【问题讨论】:

    标签: node.js google-oauth gmail-api


    【解决方案1】:

    Gmail API 允许您在 specific timestamp with second accuracy 之后列出线程/消息。

    假设您想在Friday, 22-Jul-16 00:00:00 UTC 之后收到消息的list threads,您可以在q 参数中写入after:1469145600

    请求

    GET https://www.googleapis.com/gmail/v1/users/me/threads?q=after%3A1469145600&access_token={YOUR_ACCESS_TOKEN}
    

    回应

    {
     "threads": [
      {
       "id": "1561153ce695b9ab",
       "snippet": "Infinite Elgintensity has uploaded Gym Idiots - Spread Eagle Rows & Mike O'Hearn 585-Lb. Squat A montage of gym fails with... Infinite Elgintensity has uploaded Gym Idiots - Spread Eagle Rows",
       "historyId": "895071"
      }
     ],
     "resultSizeEstimate": 1
    }
    

    【讨论】:

      猜你喜欢
      • 2023-04-10
      • 1970-01-01
      • 2016-09-21
      • 2015-01-12
      • 2021-11-10
      • 1970-01-01
      • 1970-01-01
      • 2014-10-08
      • 2013-02-08
      相关资源
      最近更新 更多