錯誤案例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
下列各節將重點說明 Mobile Data Plan Sharing API 最常見的錯誤情境,這些情境會導致 API 向呼叫端傳回錯誤。如果錯誤持續發生,請傳送電子郵件至 mdp-support@google.com 尋求支援,並附上呼叫的網址和要求主體。
HTTP 404 找不到
發生 HTTP 404 錯誤最常見的原因是 GTAF 找不到應傳送通知的使用者 GCM 權杖。如果裝置沒有機會或無法向 GTAF 註冊 CPID 和相關聯的 GCM 權杖,就會發生這種情況。如果裝置向 GTAF 的預先發布執行個體註冊,但通知傳送至 GTAF 的正式版執行個體,也可能發生這種情況。
如要診斷這項錯誤,請按照下列步驟操作:
- 確認裝置已成功載入 MDP 使用者介面。
- 請確保呼叫中的路徑參數和查詢參數經過網址編碼。
- 請嘗試使用預先發布 (preprod-mobiledataplansharing.googleapis.com) 和正式版端點 (mobiledataplansharing.googleapis.com)。
HTTP 400 錯誤的要求
當傳送至 GTAF 的要求主體無效時,就會發生這項錯誤。最常見的情境如下:
- PlanStatus 中的 updateTime 未提供或在未來。
- PlanStatus 中的 expireTime 未提供或已過期。
- 缺少 userKey 查詢參數。
- 建構通知所需的欄位不齊全。
如要瞭解如何觸發通知,請參閱通知指南。
HTTP 409 衝突
如果快取中的 PlanStatus 比要求中傳送的更新時間更新,GTAF 就會向呼叫端傳回這項錯誤。請檢查記錄,確認是否已為這位使用者推送 PlanStatus。
HTTP 403 Forbidden
如果呼叫端未獲授權,無法針對網址中使用的特定 ASN 呼叫 Mobile Data Plan Sharing API,GTAF 就會傳回這項錯誤。如要診斷這項錯誤,請按照下列步驟操作:
- 確認您已在 Google Cloud 控制台的 API 程式庫中啟用 API。
- 用於呼叫的服務帳戶已新增至電信業者的 ISP 入口網站。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[],["The Mobile Data Plan Sharing API returns errors in specific scenarios. HTTP 404 occurs when the user's GCM token is not found. Actions to diagnose: ensure MDP UI loads, check URL encoding, and try pre-prod/prod endpoints. HTTP 400 occurs with invalid request bodies, requiring valid `updateTime` and `expireTime`, a `userKey`, and all fields needed for notifications. HTTP 409 means the cached `PlanStatus` is more recent. HTTP 403 indicates caller authorization issues; ensure the API is enabled and the service account is in the ISP portal.\n"]]