โค้ดตอบกลับสถานะ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ระบบอาจแสดงรหัสสถานะต่อไปนี้ในการตอบกลับ HTTP
รหัส HTTP |
คำอธิบาย HTTP |
หมายเหตุ |
2xx |
ตกลง |
ไม่ใช่ข้อผิดพลาด แสดงผลเมื่อดำเนินการสำเร็จ นอกจากนี้ คุณควรใช้รหัสนี้ในกรณีที่ตรรกะทางธุรกิจไม่สําเร็จ (เช่น booking_failure ใน CreateBookingResponse ได้รับการป้อนข้อมูล) |
400 |
คำขอไม่ถูกต้อง |
Bad Request/Invalid Arguments (merchant, service, slot not found, trying to book an invalid slot, cancelling a booking that never existed) |
401 |
ไม่ได้รับอนุมัติ |
ไม่ได้รับการตรวจสอบสิทธิ์ (ข้อมูลเข้าสู่ระบบไม่ถูกต้อง ให้ลองลงชื่อเข้าใช้อีกครั้ง) คำขอไม่มีข้อมูลเข้าสู่ระบบการตรวจสอบสิทธิ์ที่ถูกต้องสำหรับการดำเนินการ |
403 |
ต้องห้าม |
สิทธิ์ถูกปฏิเสธ/ไม่ได้รับอนุญาต (รู้จักผู้โทรและปฏิเสธ) ไม่ควรใช้การตอบกลับนี้สำหรับการปฏิเสธที่เกิดจากทรัพยากรบางอย่างหมด (ใช้ Too Many Requests แทนสำหรับข้อผิดพลาดเหล่านั้น)
ห้ามใช้ Forbidden หากไม่สามารถระบุตัวผู้ที่โทรเข้ามาได้ (ใช้ Unauthorized แทนสำหรับข้อผิดพลาดเหล่านั้น) |
404 |
ไม่พบ |
ไม่พบ (ไม่พบทรัพยากร, URL ไม่ถูกต้อง รวมถึง RPC ที่ไม่ถูกต้อง) |
409 |
ปมปัญหา |
ระบบยกเลิกการดำเนินการ ซึ่งมักเกิดจากปัญหาการทำงานพร้อมกัน เช่น การตรวจสอบตัวจัดลำดับไม่สำเร็จหรือการยกเลิกธุรกรรม |
429 |
มีคำขอมากเกินไป |
ทรัพยากรบางอย่างหมดแล้ว เช่น อาจใช้โควต้าต่อผู้ใช้ครบแล้ว หรือระบบไฟล์ทั้งระบบไม่มีพื้นที่ว่าง |
499 |
คำขอที่ลูกค้าปิดแล้ว |
การดำเนินการถูกยกเลิก โดยปกติแล้วผู้โทรจะเป็นผู้ยกเลิก |
500 |
ข้อผิดพลาดภายในเซิร์ฟเวอร์ |
ข้อผิดพลาดภายใน ซึ่งหมายความว่าอินตัวแปรบางรายการที่ระบบพื้นฐานคาดไว้ใช้งานไม่ได้ รหัสข้อผิดพลาดนี้สงวนไว้สำหรับข้อผิดพลาดร้ายแรง |
501 |
ไม่ได้ใช้งาน |
การดำเนินการนี้ยังไม่เสร็จสิ้นหรือไม่รองรับ/เปิดใช้ในบริการนี้ |
503 |
ไม่สามารถให้บริการได้ |
ไม่พร้อมให้บริการนี้ในขณะนี้ ปัญหานี้อาจเกิดจากเงื่อนไขชั่วคราว ซึ่งแก้ไขได้ด้วยการลองอีกครั้งโดยลดจำนวน |
504 |
เกตเวย์หมดเวลา |
กำหนดเวลาหมดอายุก่อนที่การดำเนินการจะเสร็จสมบูรณ์ สําหรับการดําเนินการที่เปลี่ยนสถานะของระบบ ระบบอาจแสดงข้อผิดพลาดนี้แม้ว่าการดําเนินการจะเสร็จสมบูรณ์แล้วก็ตาม ตัวอย่างเช่น การตอบกลับที่สำเร็จจากเซิร์ฟเวอร์อาจล่าช้านานพอที่จะทำให้พ้นกำหนดเวลา |
บางครั้งอาจมีรหัสข้อผิดพลาดหลายรหัส บริการควรแสดงรหัสข้อผิดพลาดที่เฉพาะเจาะจงที่สุดซึ่งเกี่ยวข้อง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eHTTP status codes indicate the outcome of a request, ranging from success (2xx) to various error types.\u003c/p\u003e\n"],["\u003cp\u003eClient errors (4xx) signal issues like bad requests, authentication failures, or missing resources.\u003c/p\u003e\n"],["\u003cp\u003eServer errors (5xx) represent problems on the server side, such as internal errors or service unavailability.\u003c/p\u003e\n"],["\u003cp\u003eSpecific error codes provide detailed information about the nature of the problem, enabling appropriate action.\u003c/p\u003e\n"],["\u003cp\u003eWhen multiple error codes could apply, the most specific one should be used.\u003c/p\u003e\n"]]],["HTTP responses can include various status codes. Successful operations return a 2xx code. Client-side errors include 400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), 429 (Too Many Requests), and 499 (Client Closed Request). Server-side errors are 500 (Internal Server Error), 501 (Not Implemented), 503 (Service Unavailable), and 504 (Gateway Timeout). The most specific error code should be returned when multiple codes apply.\n"],null,["# Status Response Codes\n\nThe following status codes can be returned in HTTP responses.\n\n| HTTP Code | HTTP Description | Notes |\n|-----------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 2xx | OK | Not an error; returned on success. This should also be used for business logic failures (e.g. `booking_failure` in [`CreateBookingResponse`](/actions-center/verticals/reservations/e2e/reference/booking-server-api-rest/e2e-methods/createbooking-method) is populated) |\n| 400 | Bad Request | Bad Request/Invalid Arguments (merchant, service, slot not found, trying to book an invalid slot, cancelling a booking that never existed). |\n| 401 | Unauthorized | Unauthenticated (invalid credentials, retry login). The request does not have valid authentication credentials for the operation. |\n| 403 | Forbidden | Permission denied/forbidden (caller is known and rejected). This response must not be used for rejections caused by exhausting some resource (use `Too Many Requests` instead for those errors). `Forbidden` must not be used if the caller can not be identified (use `Unauthorized` instead for those errors). |\n| 404 | Not Found | Not found (Resource not found, invalid url, including invalid RPCs) |\n| 409 | Conflict | The operation was aborted, typically due to a concurrency issue such as a sequencer check failure or transaction abort. |\n| 429 | Too Many Requests | Some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. |\n| 499 | Client Closed Request | The operation was cancelled, typically by the caller. |\n| 500 | Internal Server Error | Internal errors. This means that some invariants expected by the underlying system have been broken. This error code is reserved for serious errors. |\n| 501 | Not Implemented | The operation is not implemented or is not supported/enabled in this service. |\n| 503 | Service Unavailable | The service is currently unavailable. This is most likely a transient condition, which can be corrected by retrying with a backoff. |\n| 504 | Gateway Timeout | The deadline expired before the operation could complete. For operations that change the state of the system, this error may be returned even if the operation has completed successfully. For example, a successful response from a server could have been delayed long enough for the deadline to expire. |\n\nSometimes multiple error codes may apply. Services should return the most\nspecific error code that applies."]]