我已经浏览了Google网站上的所有prereqs .
-
在服务器上获得并安装了SSL证书(来自Let的加密) .
-
在Google Search Console上注册并验证了域名(是的,https网址)(例如https://example.org) .
-
已将域添加到我的API Credential的Domain Verification .
topic ='projects / myproject / subscriptions / mytopic'sub ='projecs / myproject / subscription / mysub'client.projects() . topics() . create(topic = topic,body = {}) . execute()client . projects() . subscriptions() . create(name = sub,body = {'topic':topic,'pushConfig':{'pushEndpoint':'https://example.org/push-handler'}})
我回来了:
googleapiclient.errors.HttpError:https://pubsub.googleapis.com/v1/projects/myproject/subscriptions/mysub ?alt = json返回“给出无效的推送 endpoints (endpoint = https://example.org/push-handler ) . 有关详细信息,请参阅https://cloud.google.com/pubsub/subscriber#create . “>
此外,我无法从Google的Pub / Sub开发者控制台创建订阅 . 当我尝试时,我收到“无法添加订阅”通知 . 我是此主题和项目的完整所有者,具有读写权限 . 我可以添加pull订阅没有问题 .
有什么想法吗?好像我不是在打这个 .
1 回答
弄清楚了 . 我在域验证中包含了协议(https://example.org),而不仅仅是example.org . 域验证工具提供一些验证可以防止这种情况,这本来是很好的 .
https://console.developers.google.com/apis/credentials/domainverification