得到这个输出,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 不是纪元时间,而是一个 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
关于python - 用户配置文件 gmail api 中的历史记录 ID 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54781005/