Google Classroom API से जुड़ी गड़बड़ी का स्ट्रक्चर
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Classroom API, गड़बड़ी की जानकारी देता है. इससे डेवलपर को समस्याओं को डीबग करने में मदद मिलती है. साथ ही, वे असली उपयोगकर्ताओं को काम की और कार्रवाई करने के लिए ज़रूरी जानकारी दे पाते हैं. इस गाइड में, एपीआई से मिली गड़बड़ी की जानकारी को पार्स करने का तरीका बताया गया है.
Classroom API, गड़बड़ी की जानकारी के दो लेवल दिखाता है:
हेडर में एचटीटीपी गड़बड़ी का कोड.
जवाब के मुख्य हिस्से में मौजूद एक ऑब्जेक्ट, जिसमें ज़्यादा जानकारी होती है.
गड़बड़ी के मैसेज का स्ट्रक्चर
जवाब के मुख्य भाग में दिखाई गई गड़बड़ियों में ये फ़ील्ड शामिल होते हैं:
code: एचटीटीपी गड़बड़ी का संख्यात्मक कोड. उदाहरण के लिए, 403.
message: गड़बड़ी के बारे में ज़्यादा जानकारी. उपलब्ध होने पर, गड़बड़ी के मैसेज से पहले @ और गड़बड़ी का टाइप जोड़ा जाता है. उदाहरण के लिए,
@ClassroomApiDisabled.
status: एचटीटीपी अनुरोध का स्टेटस. उदाहरण के लिए, PERMISSION_DENIED या NOT_FOUND.
अगर किसी अनुरोध को ClassroomApiDisabled गड़बड़ी की वजह से पूरा नहीं किया जा सका, तो जवाब इस तरह दिखेगा:
{"error":{"code":403,"message":"@ClassroomApiDisabled The user is not permitted to access the Classroom API.","status":"PERMISSION_DENIED"}}
जवाब के मुख्य हिस्से का इस्तेमाल करके, गड़बड़ी की वजह का पता लगाया जा सकता है. साथ ही, उपयोगकर्ताओं को काम की जानकारी दी जा सकती है. किसी गड़बड़ी के मैसेज की जांच करते समय, आखिर में एक स्पेस शामिल करें. इससे, ऐसी अन्य वैल्यू से मैच होने से बचा जा सकेगा जो एक ही स्ट्रिंग से शुरू होती हैं. गड़बड़ी के दिए गए उदाहरण में, यह देखा जा सकता है कि मैसेज फ़ील्ड "@ClassroomApiDisabled " से शुरू होता है या नहीं, ताकि उपयोगकर्ताओं को सही जानकारी दी जा सके.
Classroom API से मिलने वाली कुछ गड़बड़ियों के बारे में जानने के लिए, सामान्य गड़बड़ियां पेज देखें.
[[["समझने में आसान है","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-08-29 (UTC) को अपडेट किया गया."],[],[],null,["# Google Classroom API error structure\n\nThe Classroom API returns error information that can help developers\ndebug issues and provide helpful, actionable information to end users. This\nguide explains how to parse error information returned from the API.\n\nThe Classroom API returns two levels of error information:\n\n- HTTP error code in the header.\n- An object in the response body with additional details.\n\nError message structure\n-----------------------\n\nErrors returned in the response body include the following fields:\n\n- `code`: The numerical HTTP error code. For example, `403`.\n- `message`: Additional details about the error. When available, the error message is prepended with `@` and a specific error type. For example, `@ClassroomApiDisabled`.\n- `status`: The HTTP request status. For example, `PERMISSION_DENIED` or `NOT_FOUND`.\n\nIf a request failed with a [`ClassroomApiDisabled`](/workspace/classroom/troubleshooting/common-errors#classroom-api-disabled) error, the response would\nbe: \n\n {\n \"error\": {\n \"code\": 403,\n \"message\": \"@ClassroomApiDisabled The user is not permitted to access the Classroom API.\",\n \"status\": \"PERMISSION_DENIED\"\n }\n }\n\nYou can use the response body to help you debug the cause of the error and\nprovide helpful information to users. Include a trailing space when checking\nfor a specific error message to avoid matching other values that start with\nthe same string. In the provided error example, you can check if the message\nfield begins with `\"@ClassroomApiDisabled \"` to present appropriate information\nto users.\n\nReference the [Common errors](/workspace/classroom/troubleshooting/common-errors) page for information on some errors that\ncan be returned by the Classroom API."]]