Pub Sub Topic not associated with Project error

自闭症网瘾萝莉.ら 提交于 2019-12-11 17:07:55

问题


I'm trying to subscribe to push notifications from Google Classroom using this link and getting the following error. I have created the project, the topic and subscription under the same project and added the service account permissions as noted in the docs.

Right now I'm working on this in the API Explorer on this page.

I can verify that the topic lives under the developer console project.

Are there any other issues that would cause the topic to not be visible in this project?

{
  "error": {
    "code": 403,
    "message": "@TopicNotOwnedByProject The specified Cloud Pub/Sub topic does not belong to your Developer Console project.",
    "status": "PERMISSION_DENIED"
  }
}

回答1:


After a lot of frustration, I've realized that running the API Explorer will never result in a succesful API call because the API calls are not in my project scope but instead, whatever project the "API Explorer" runs in. This could be resolved if the API Explorer allowed you to select a project to run the sample requests in.

I went ahead and wrote out the code directly and it is working as expected.



来源:https://stackoverflow.com/questions/52562731/pub-sub-topic-not-associated-with-project-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!