Google Classroom ऐड-ऑन अब आम तौर पर डेवलपर के लिए उपलब्ध हैं! ज़्यादा जानकारी के लिए, कृपया
ऐड-ऑन दस्तावेज़ देखें.
Method: userProfiles.checkUserCapability
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इससे यह पता चलता है कि कोई उपयोगकर्ता, Classroom की दी गई सुविधा का इस्तेमाल कर सकता है या नहीं. उदाहरण के लिए, इस एंडपॉइंट का इस्तेमाल यह देखने के लिए किया जा सकता है कि कोई उपयोगकर्ता ऐड-ऑन अटैचमेंट बना सकता है या नहीं.अनुरोध करने वाला उपयोगकर्ता, सिर्फ़ अपने लिए उपलब्ध सुविधाओं की जांच कर सकता है.
यह तरीका, गड़बड़ी के ये कोड दिखाता है:
PERMISSION_DENIED
अगर अनुरोध करने वाले उपयोगकर्ता को, तय किए गए उपयोगकर्ता के लिए ज़रूरी शर्तें पूरी होने की जांच करने की अनुमति नहीं है.
INVALID_ARGUMENT
अगर अनुरोध गलत तरीके से किया गया हो.
एचटीटीपी अनुरोध
GET https://classroom.googleapis.com/v1/userProfiles/{userId}:checkUserCapability
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
userId |
string
ज़रूरी है. उपयोगकर्ता का आइडेंटिफ़ायर. अनुरोध के पैरामीटर के तौर पर तय किए जाने पर, यह आइडेंटिफ़ायर इनमें से कोई एक हो सकता है:
- उपयोगकर्ता के लिए संख्या वाला आइडेंटिफ़ायर
- उपयोगकर्ता का ईमेल पता
- स्ट्रिंग लिटरल
"me" , जिससे अनुरोध करने वाले उपयोगकर्ता के बारे में पता चलता है
|
क्वेरी पैरामीटर
पैरामीटर |
capability |
enum (Capability )
ज़रूरी है. वह सुविधा जिसकी इस उपयोगकर्ता के लिए जांच की जानी चाहिए. उदाहरण के लिए, यह देखने के लिए कि कोई उपयोगकर्ता ऐड-ऑन अटैचमेंट बना सकता है या नहीं, इसे CREATE_ADD_ON_ATTACHMENT पर सेट करें.
|
previewVersion |
enum (PreviewVersion )
ज़रूरी नहीं. एपीआई का प्रीव्यू वर्शन.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य भाग
उपयोगकर्ता की क्षमताओं की जांच करने पर मिला जवाब.
अगर एपीआई सही से जुड़ जाता है, ताे जवाब के मुख्य भाग में नीचे दिए गए स्ट्रक्चर शामिल होता है.
JSON के काेड में दिखाना |
{
"capability": enum (Capability ),
"allowed": boolean
} |
फ़ील्ड |
capability |
enum (Capability )
Classroom में शामिल सुविधा.
|
allowed |
boolean
इससे पता चलता है कि उपयोगकर्ता को बताई गई सुविधा इस्तेमाल करने की अनुमति है या नहीं.
|
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/classroom.courses
https://www.googleapis.com/auth/classroom.courses.readonly
ज़्यादा जानकारी के लिए, अनुमति पाने से जुड़ी गाइड देखें.
अनुमति
क्षमता को दिखाने वाला enum.
Enums |
CAPABILITY_UNSPECIFIED |
समर्थित नहीं. |
CREATE_ADD_ON_ATTACHMENT |
अनुरोध करने के लिए इस्तेमाल किए गए OAuth क्लाइंट आईडी के Developer Console प्रोजेक्ट से जुड़े AddOnAttachments बनाने और उनमें बदलाव करने की सुविधा. |
CREATE_RUBRIC |
रूब्रिक बनाने और उनमें बदलाव करने की सुविधा. |
UPDATE_GRADING_PERIOD_SETTINGS |
ग्रेडिंग पीरियड की सेटिंग में बदलाव करने की सुविधा. |
CREATE_STUDENT_GROUP |
छात्र-छात्राओं के ग्रुप और उनके सदस्यों को बनाने और उनमें बदलाव करने की सुविधा. |
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-06 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-06 (UTC) को अपडेट किया गया."],[],[],null,["# Method: userProfiles.checkUserCapability\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.CheckUserCapabilityResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Capability](#Capability)\n\n\u003cbr /\u003e\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. This feature is available in [V1_20240930_PREVIEW](https://developers.google.com/workspace/classroom/reference/rest/v1/PreviewVersion) and later. See [Access Preview APIs](https://developers.google.com/workspace/classroom/reference/preview) to learn more.\nReturns whether a user may use the specified Classroom capability. For example, this endpoint can be used to check whether a user may create add- on attachments.\n\n\u003cbr /\u003e\n\nA requesting user can only check capabilities for themselves.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to check eligibility for the specified user.\n- `INVALID_ARGUMENT` if the request is malformed.\n\n### HTTP request\n\n`GET https://classroom.googleapis.com/v1/userProfiles/{userId}:checkUserCapability`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `userId` | `string` Required. Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: - the numeric identifier for the user - the email address of the user - the string literal `\"me\"`, indicating the requesting user |\n\n### Query parameters\n\n| Parameters ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `capability` | `enum (`[Capability](/workspace/classroom/reference/rest/v1/userProfiles/checkUserCapability#Capability)`)` Required. The Capability that should be checked for this user. For example, to check whether a user can create an [add-on attachment](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork.addOnAttachments#resource:-addonattachment), set this to `CREATE_ADD_ON_ATTACHMENT`. |\n| `previewVersion` | `enum (`[PreviewVersion](/workspace/classroom/reference/rest/v1/PreviewVersion)`)` Optional. The preview version of the API. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse from checking user capabilities.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"capability\": enum (/workspace/classroom/reference/rest/v1/userProfiles/checkUserCapability#Capability), \"allowed\": boolean } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `capability` | `enum (`[Capability](/workspace/classroom/reference/rest/v1/userProfiles/checkUserCapability#Capability)`)` The Classroom capability. |\n| `allowed` | `boolean` Whether the specified capability is allowed for the user. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.courses`\n- `\n https://www.googleapis.com/auth/classroom.courses.readonly`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nCapability\n----------\n\nEnum to represent the capability.\n\n| Enums ||\n|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `CAPABILITY_UNSPECIFIED` | Not supported. |\n| `CREATE_ADD_ON_ATTACHMENT` | The capability to create and modify AddOnAttachments associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. |\n| `CREATE_RUBRIC` | The capability to create and modify Rubrics. |\n| `UPDATE_GRADING_PERIOD_SETTINGS` | The capability to modify grading period settings. |\n| `CREATE_STUDENT_GROUP` | The capability to create and modify student groups and their members. |"]]