gmail API中的监视请求没有

2024-06-01 14:32:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用python发出一个监视请求,如google APIs中所述,但它不起作用。在

request = {
  'labelIds': ['INBOX'],
  'topicName': 'projects/myproject/topics/mytopic'
}
gmail.users().watch(userId='me', body=request).execute()

找不到要使用gmail.users()函数的库或包。如何使用访问令牌发出监视请求?在


Tags: requestmyprojectgoogleusersgmailapisprojectswatch
2条回答

在gmailpython客户端(由google提供)中执行

request = {
        'labelIds': ['INBOX'],
        'topicName': 'projects/myprojects/topics/getTopic'
    }
    print(service.users().watch(userId='me', body=request).execute())
const { google } = require('googleapis') 
const gmail = google.gmail({ version: 'v1' }) 

gmail只是客户端库中的一个对象。上面是节点js库。在python客户机库中查找答案。在

这是我不喜欢的一点,很多谷歌文档在他们的api上,他们假设你知道加载了什么,或者在某个不知名的地方看到了一个例子。在

相关问题 更多 >