本頁面說明應用程式開發人員如何解決資料可攜權 API 的問題。
這個範圍不允許增量驗證
如果您使用 include_granted_scopes=true
要求 Data Portability API 範圍的 OAuth 流程,而使用者已將部分範圍授予專案,或使用者已授予部分要求的範圍,就會發生下列問題。
Incremental auth is not allowed for the requested scopes. If you are a developer ofAPP_NAME , see error details. Error 400: invalid_request
如要解決這個問題,請從要求中移除 include_granted_scopes
,或將其設為 false,並只要求使用者未授予的範圍。詳情請參閱「先前授予的權限範圍」。
沒有續訂選項
如果使用者授予測試發布狀態專案的存取權,就會發生下列問題。續約僅適用於發布狀態為「實際運作中」的專案。使用者不會在「我的帳戶」連結頁面上看到續約選項。
如要解決這個問題,請將專案的發布狀態變更為「正式版」。詳情請參閱「設定 OAuth 工作流程」。
要求的資源未經授權
當您向 Data Portability API 提出要求,為資源群組啟動工作,但該群組的範圍未在附加的 OAuth 存取權權杖中授予時,就會發生下列問題。
HttpError 403 when requesting https://dataportability.googleapis.com/v1/portabilityArchive:initiate?alt=json returned "The requested resources are not authorized by the OAuth token.". Details: "[{'@type': 'type.googleapis.com/google.rpc.DebugInfo', 'detail': '[ORIGINAL ERROR] generic::permission_denied: com.google.dataliberation.portability.boq.thirdparty.utils.PortabilityApiException: The requested resources are not authorized by the OAuth token. Code: PERMISSION_DENIED [google.rpc.error_details_ext] { message: "The requested resources are not authorized by the OAuth token." }'}]"
如要解決這個問題,請追蹤哪些 OAuth 權杖授予哪些範圍。如果使用者透過多個流程授予不同的權限範圍,您可能需要為同一位使用者儲存多個不同的權杖。另外請注意,使用者可能只授予 OAuth 流程中要求的部分範圍。如需範例,請參閱 Python 快速入門。
要求多個範圍時,在 https://takeout.google.com/dpinfo 發生 400 錯誤
當網址長度因要求中範圍數量而超出支援範圍時,https://takeout.google.com/dpinfo 會擲回 400 錯誤。如要解決這個問題,請將範圍要求分割為多個較小的批次。