本文档介绍了 Google API 返回的一些错误代码和消息。具体而言,此处列出的错误可能存在于 Google API 的全局网域中,也可能存在于默认网域中。许多 API 还会定义自己的网域,可识别出全局网域以外特定于 API 的错误。对于这些错误,JSON 响应中 domain 属性的值将会是一个特定于 API 的值,例如 youtube.parameter。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Error messages\n\nThis document identifies some of the error codes and messages that Google APIs return. Specifically, the errors listed here are in the global, or default, domain for Google APIs. Many APIs also define their own domains, which identify API-specific errors that are not in the global domain. For those errors, the value of the `domain` property in the JSON response will be an API-specific value, such as `youtube.parameter`.\n\nThis page lists errors by their HTTP status codes as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-6).\n\nThe sample JSON response below demonstrates how a global error is communicated: \n\n```transact-sql\n{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"invalidParameter\",\n \"message\": \"Invalid string value: 'asdf'. Allowed values: [mostpopular]\",\n \"locationType\": \"parameter\",\n \"location\": \"chart\"\n }\n ],\n \"code\": 400,\n \"message\": \"Invalid string value: 'asdf'. Allowed values: [mostpopular]\"\n }\n}\n```\n\nErrors\n------\n\n1. [MOVED_PERMANENTLY (301)](#MOVED_PERMANENTLY)\n2. [SEE_OTHER (303)](#SEE_OTHER)\n3. [NOT_MODIFIED (304)](#NOT_MODIFIED)\n4. [TEMPORARY_REDIRECT (307)](#TEMPORARY_REDIRECT)\n5. [BAD_REQUEST (400)](#BAD_REQUEST)\n6. [UNAUTHORIZED (401)](#UNAUTHORIZED)\n7. [PAYMENT_REQUIRED (402)](#PAYMENT_REQUIRED)\n8. [FORBIDDEN (403)](#FORBIDDEN)\n9. [NOT_FOUND (404)](#NOT_FOUND)\n10. [METHOD_NOT_ALLOWED (405)](#METHOD_NOT_ALLOWED)\n11. [CONFLICT (409)](#CONFLICT)\n12. [GONE (410)](#GONE)\n13. [PRECONDITION_FAILED (412)](#PRECONDITION_FAILED)\n14. [REQUEST_ENTITY_TOO_LARGE (413)](#REQUEST_ENTITY_TOO_LARGE)\n15. [REQUESTED_RANGE_NOT_SATISFIABLE (416)](#REQUESTED_RANGE_NOT_SATISFIABLE)\n16. [EXPECTATION_FAILED (417)](#EXPECTATION_FAILED)\n17. [PRECONDITION_REQUIRED (428)](#PRECONDITION_REQUIRED)\n18. [TOO_MANY_REQUESTS (429)](#TOO_MANY_REQUESTS)\n19. [INTERNAL_SERVER_ERROR (500)](#INTERNAL_SERVER_ERROR)\n20. [NOT_IMPLEMENTED (501)](#NOT_IMPLEMENTED)\n21. [SERVICE_UNAVAILABLE (503)](#SERVICE_UNAVAILABLE)\n\n### MOVED_PERMANENTLY (301)\n\n### SEE_OTHER (303)\n\n### NOT_MODIFIED (304)\n\n### TEMPORARY_REDIRECT (307)\n\n### BAD_REQUEST (400)\n\n### UNAUTHORIZED (401)\n\n### PAYMENT_REQUIRED (402)\n\n### FORBIDDEN (403)\n\n### NOT_FOUND (404)\n\n### METHOD_NOT_ALLOWED (405)\n\n### CONFLICT (409)\n\n### GONE (410)\n\n### PRECONDITION_FAILED (412)\n\n### REQUEST_ENTITY_TOO_LARGE (413)\n\n### REQUESTED_RANGE_NOT_SATISFIABLE (416)\n\n### EXPECTATION_FAILED (417)\n\n### PRECONDITION_REQUIRED (428)\n\n### TOO_MANY_REQUESTS (429)\n\n### INTERNAL_SERVER_ERROR (500)\n\n### NOT_IMPLEMENTED (501)\n\n### SERVICE_UNAVAILABLE (503)"]]