gpt4 book ai didi

gmail-api - Gmail API 监视请求无法正常工作

转载 作者:行者123 更新时间:2023-12-02 04:33:32 26 4
gpt4 key购买 nike

There are many post on this same topic but still there is no exact solution to solve this issue.
即使在下面链接的谷歌 API 中,也可以选择测试 API
https://developers.google.com/gmail/api/v1/reference/users/watch

这个 API 会抛出类似 Invalid Topic Name does not match 的错误但我已经在 pub sub 中创建了主题,并在其上发布了消息,该主题工作正常,但我也收到以下错误。我收到 400 错误

{ "error": {"errors": [{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid topicName does not match projects/google.com:apisexplorerconsole/topics/*" } ],"code": 400,"message":"Invalid topicName does not match projects/google.com:apisexplorerconsole/topics/*" }}

我试图在客户端调用这个 API,如下所示
gapi.client.gmail.users.watch({
'userId': 'me',
"topicName": "projects/fast-metric-178608/topics/Test"
}).then(function (response) {
console.log(response)
});

下面是输出,我收到 403 错误
{ "error": { "errors": [{
"domain": "global",
"reason": "forbidden",
"message": "Error sending test message to Cloud PubSub projects/fast-metric-178608/topics/Test : User not authorized to perform this action."} ],"code": 403, "message": "Error sending test message to Cloud PubSub projects/fast-metric-178608/topics/Test : User not authorized to perform this action." }}

最佳答案

https://console.cloud.google.com/cloudpubsub/topicList

选择您的主题和
设置您的主题 PERMISSIONS allUser 并选择角色发布/订阅管理员

关于gmail-api - Gmail API 监视请求无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46191637/

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