WebhookNotification
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
設定長時間執行的作業資源,在資源更新時,從 Google Analytics (分析) Data API 傳送 Webhook 通知到您的 Webhook 伺服器。
通知設定包含不公開的值,且只有您的 GCP 專案看得見。不同的 GCP 專案可能會將不同的 Webhook 通知附加至同一個長時間執行的作業資源。
JSON 表示法 |
{
"uri": string,
"channelToken": string
} |
欄位 |
uri |
string
選用設定。接收 Webhook 通知的網址。這個位址會收到 POST 要求,做為長時間執行的作業資源狀態變更。POST 要求會在主體中同時包含長時間執行作業資源的 JSON 版本及 sentTimestamp 欄位。傳送的時間戳記會指定自要求傳送週期以來的 Unix 微秒;您可以藉此找出重播通知。 URI 範例如下:https://us-central1-example-project-id.cloudfunctions.net/example-function-1 。 URI 必須採用 HTTPS,並指向在網路伺服器上具備有效 SSL 憑證的網站。URI 的字串長度上限為 128 個字元,且只能使用 RFC 1738 中加入許可清單的字元。 您的 Webhook 伺服器收到通知,應會在 5 秒內傳回 HTTP 回應狀態碼 200。 必須提供 URI 才能使用 Webhook 通知。 傳送至這個 Webhook 伺服器的要求會包含 ID 權杖,用於驗證服務帳戶 google-analytics-audience-export@system.gserviceaccount.com 。如要進一步瞭解 ID 權杖,請參閱 https://cloud.google.com/docs/authentication/token-types#id。以 Google Cloud Functions 來說,這可讓您將函式設為需要驗證。在 Cloud IAM 中,您需要將服務帳戶權限授予 Cloud Run 叫用者 (roles/run.invoker ) 和 Cloud Functions 叫用者 (roles/cloudfunctions.invoker ) 角色,讓 Webhook 發布要求傳遞 Google Cloud Functions 驗證。這個 API 可將 Webhook 通知傳送至任意 URI;如果是 Google Cloud Functions 以外的 Webhook 伺服器,如果不需要,請忽略授權不記器標頭中的 ID 權杖。
|
channelToken |
string
選用設定。頻道權杖是任意字串值,且字串長度上限為 64 個半形字元。管道權杖可讓您驗證 Webhook 通知的來源。避免郵件遭到假冒。系統會在 Webhook POST 要求的 X-Goog-Channel-Token HTTP 標頭中指定管道權杖。 您不需要管道權杖就能使用 Webhook 通知。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-05-02 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]