6

我已经浏览了Google 网站上的所有先决条件。

  1. 在服务器上获取并安装了 SSL 证书(来自 Let's Encrypt)。

  2. 在 Google Search Console(如https://example.org )上注册并验证了域(是的,https url )。

  3. 将域添加到我的 API 凭据的域验证中。

主题='项目/我的项目/订阅/我的主题'

sub='项目/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 返回“给定的推送端点无效(端点= https://example.org/push-handler) . 有关详细信息,请参阅https://cloud.google.com/pubsub/subscriber#create。">

此外,我无法从 Google 的 Pub/Sub 开发者控制台创建订阅。当我尝试时,我收到“无法添加订阅”通知。我是这个主题和项目的完全所有者,具有读写权限。我可以毫无问题地添加拉订阅。

关于为什么的任何想法?好像我不是唯一一个打这个的。

4

1 回答 1

7

弄清楚了。我在域验证中包含了协议 ( https://example.org ),而不仅仅是 example.org。如果域验证工具提供了一些防止这种情况的验证,那就太好了。

https://console.developers.google.com/apis/credentials/domainverification

于 2016-01-17T22:25:25.537 回答