Maps Datasets API 會在回應中傳回錯誤訊息。舉例來說,如果您在要求中省略 OAuth 權杖,或是權杖已過期,要求會傳回以下內容:
{"error":{"code":401,"message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"CREDENTIALS_MISSING","domain":"googleapis.com","metadata":{"method":"google.maps.mapsplatformdatasets.v1alpha.MapsPlatformDatasetsV1Alpha.ListDatasets","service":"mapsplatformdatasets.googleapis.com"}}]}}
如果您在建立資料集時省略必要的要求主體參數 (例如 displayName),要求會傳回:
{"error":{"code":400,"message":"display_name: Display name must be provided","status":"INVALID_ARGUMENT"}}
如果您傳遞無效的資料集 ID,要求會傳回:
{"error":{"code":404,"message":"Dataset not found","status":"NOT_FOUND"}}
[[["容易理解","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-01-14 (世界標準時間)。"],[[["The Maps Datasets API returns errors with codes, messages, and status information to help you troubleshoot issues."],["Common errors include missing or expired authentication credentials (401), missing required parameters (400), and invalid dataset IDs (404)."],["Error responses provide details about the cause of the error, such as the missing credential or parameter."],["Refer to the Google Cloud error documentation for comprehensive information on error handling and troubleshooting."]]],[]]