排解 Data Portability API 問題
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁面說明應用程式開發人員如何解決資料可攜權 API 的問題。
這個範圍不允許增量驗證
如果您使用 include_granted_scopes=true
要求 Data Portability API 範圍的 OAuth 流程,而使用者已將部分範圍授予專案,或使用者已授予部分要求的範圍,就會發生下列問題。
Incremental auth is not allowed for the requested scopes.
If you are a developer of APP_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 錯誤。如要解決這個問題,請將範圍要求分割為多個較小的批次。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Troubleshoot issues with Data Portability API\n\nThis page shows you app developers how to resolve issues with the\nData Portability API.\n\nIncremental auth isn't allowed for this scope\n---------------------------------------------\n\nThe following issue occurs when you request an OAuth flow for Data Portability API\nscopes with `include_granted_scopes=true` and the end user has already granted\nsome scopes to the project, or the user has already granted some of the\nrequested scopes. \n\n```\nIncremental auth is not allowed for the requested scopes.\nIf you are a developer of APP_NAME, see error details.\nError 400: invalid_request\n```\n\nTo resolve this issue remove `include_granted_scopes` from your request or set\nit to false and only request scopes that the user hasn't granted. For details,\nsee [Previously granted scopes](/data-portability/user-guide/configure-oauth#previously_granted_scopes).\n\nNo renewal option\n-----------------\n\nThe following issue occurs when an end user grants access to a project with a\n**Testing** publishing status. Renewal is only available to projects with a\n**Production** publishing status. The end user won't see a renewal option on\ntheir myaccount connections page.\n\nTo resolve this issue change the project's publishing status to **Production** .\nFor details, see [Set up an OAuth workflow](/data-portability/user-guide/configure-oauth#set_up_an_oauth_workflow).\n\nThe requested resources are not authorized\n------------------------------------------\n\nThe following issue occurs when the you make a request to the Data Portability API\nto initiate a job for resource groups whose scopes are not granted in the\nattached OAuth access token. \n\n 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.\" }'}]\"\n\nTo resolve this issue, keep track of which scopes are granted by which OAuth\ntokens. You may need to store multiple different tokens for the same user if\nthey granted different scopes through multiple flows. Also note that a user\nmight have granted only a subset of the scopes requested in an OAuth flow. For\nexamples, see the [Python quickstart](/data-portability/user-guide/python-quickstart).\n\n400 error at https://takeout.google.com/dpinfo when requesting many scopes\n--------------------------------------------------------------------------\n\nhttps://takeout.google.com/dpinfo throws a 400 error when the URL length grows\nbeyond what is supported due to the number of scopes in your request. To\nresolve, split your requests for scopes into multiple smaller batches."]]