本文档介绍了 Google API 返回的一些错误代码和消息。具体而言,文中列出的错误都是在 Google API 的全局网域(即默认网域)中发生的。很多 API 还会指定自己的网域,用以标识不在全局网域中而仅在该 API 范围内的错误。对于这类错误,JSON 响应中 domain 属性的值将会是一个 API 范围内的值,例如 youtube.parameter。
[[["易于理解","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"]],["最后更新时间 (UTC):2024-08-20。"],[[["\u003cp\u003eGoogle APIs utilize global error codes, identified by the \u003ccode\u003eglobal\u003c/code\u003e domain, alongside API-specific errors, each categorized by HTTP status codes as defined in RFC 7231.\u003c/p\u003e\n"],["\u003cp\u003eErrors include issues such as invalid requests (\u003ccode\u003ebadRequest\u003c/code\u003e), authorization problems (\u003ccode\u003eunauthorized\u003c/code\u003e), quota or rate limit exceedances (\u003ccode\u003eforbidden\u003c/code\u003e), and resource conflicts (\u003ccode\u003econflict\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eSpecific HTTP status codes are mapped to distinct error categories, such as 300-level codes for redirects, 400-level codes for client errors, and 500-level codes for server errors.\u003c/p\u003e\n"],["\u003cp\u003eEach error code contains details like the \u003ccode\u003edomain\u003c/code\u003e, \u003ccode\u003ereason\u003c/code\u003e, \u003ccode\u003emessage\u003c/code\u003e, \u003ccode\u003elocationType\u003c/code\u003e, and \u003ccode\u003elocation\u003c/code\u003e to specify where the error occurred and give more information.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides a comprehensive breakdown of these errors, including their causes and potential remedies, for all codes listed, besides the ones that contain no information in this given document.\u003c/p\u003e\n"]]],["Google APIs return errors within a \"global\" domain or API-specific domains, categorized by HTTP status codes. Common redirection codes (3xx) indicate using a new URL. Client errors (4xx) include `BAD_REQUEST` for invalid requests, `UNAUTHORIZED` for authentication issues, and `FORBIDDEN` for access problems. Specific errors like `invalidParameter`, `quotaExceeded`, or `notFound` provide details. Codes 410, 412, 413, 416, 417, 428, 429, 500, 501, 503 cover issues such as resources being deleted or rate-limit issues.\n"],null,[]]