gpt4 book ai didi

node.js - InvalidArgument topicName 与projects/outrigger-170662/topics/gmail 不匹配

转载 作者:太空宇宙 更新时间:2023-11-04 00:12:24 25 4
gpt4 key购买 nike

我正在使用 Node.js 和 googleapis 包。连同护照一起进行身份验证。

当我在 Node.JS 应用程序上运行此代码时:

 function start(user, oauth2){                                                                                                 
// Start watching for new emails
gmail.users.watch({
auth: oauth2,
userId: 'me',
resource: {
topicName: 'projects/outrigger-170662/topics/gmail',
labelIds: ["Inbox"]
} `
}, function(err){
if (err){
console.log(err);
}
}); }

Note: I am actually passing in the user object and oauth2client, so that is not the issue.

我收到此错误:

     data: { error: [Object] } },
code: 400,
errors:
[ { domain: 'global',
reason: 'invalidArgument',
message: 'Invalid topicName does not match projects/outrigger-170622/topics/*' } ] }

我正在使用以下范围:

  'email',
'profile',
'https://www.googleapis.com/auth/calendar',
'https://mail.google.com/',
'https://www.googleapis.com/auth/contacts'

我已在 Google Cloud 控制台上创建了 Gmail 主题,并将 allUsers 设置为发布者。我有什么遗漏的吗?

该网站已上线:https://outrigger.herokuapp.com/

最佳答案

根据错误消息,您的实际项目 ID 为 outrigger-170622,但在您的请求中,您发送的是 outrigger-170662。看来此错误是由 662 与 622 的拼写错误引起的。尝试修复此问题并查看错误是否消失。

关于node.js - InvalidArgument topicName 与projects/outrigger-170662/topics/gmail 不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48875556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com