用户配置文件 gmail api 中的历史 ID 是什么?

what is history id in user profile gmail api?

得到这个输出 historyId 是什么意思,是纪元时间吗?

UserInfo is 
 {'emailAddress': 'sssss@gmail.com', 'messagesTotal': 22919, 'threadsTotal': 22016, 'historyId': '1727906'}

使用代码

from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from dateutil.relativedelta import relativedelta
from datetime import datetime


SCOPES = 'https://www.googleapis.com/auth/gmail.readonly'


userInfo = service.users().getProfile(userId='me').execute()
print ("UserInfo is \n %s" % (userInfo))

Anwser: HistoryID 不是 epoc time 它的一个 id。

历史ID定义

直接来自文档getprofile

historyId unsigned long The ID of the mailbox's current history record.

用法

用于 history.list

Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).

也用于以下

将客户端与 Gmail 同步

让您的客户端与 Gmail 保持同步对于大多数应用场景来说都很重要。总体同步场景有两种:全同步和部分同步。在您的客户端第一次连接到 Gmail 时以及在其他一些罕见的情况下,需要完全同步。如果您的客户端最近进行了同步,则部分同步是完全同步的轻量级替代方案。您还可以使用推送通知实时触发部分同步,仅在必要时触发,从而避免不必要的轮询。

您可能还会发现 sync