我已經瀏覽了Google網站上的所有prereqs。創建Google Pub/Sub訂閱期間無效的推送端點錯誤
在服務器上獲得並安裝了SSL證書(來自Let's Encrypt)。
在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 returned "Invalid push endpoint given (endpoint= https://example.org/push-handler). Refer to https://cloud.google.com/pubsub/subscriber#create for more information.">
而且,我無法創建谷歌的發佈/訂閱開發者控制檯訂閱。當我嘗試時,我收到「訂閱無法添加」通知。我是這個主題和項目的完整所有者,擁有讀寫權限。我能夠添加沒有問題的訂閱。
任何想法爲什麼?看起來我並不是only one。
您如何驗證您的請求? –
私鑰。它在創建主題時起作用,所以我知道Google的身份驗證工作正常。 – ehfeng