Google Classroom ऐड-ऑन अब आम तौर पर डेवलपर के लिए उपलब्ध हैं! ज़्यादा जानकारी के लिए, कृपया
ऐड-ऑन दस्तावेज़ देखें.
Method: registrations.create
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Registration
बनाता है. इससे Classroom, दिए गए feed
से cloudPubSubTopic
में दिए गए डेस्टिनेशन पर सूचनाएं भेजना शुरू कर देता है.
बनाया गया Registration
दिखाता है. फ़िलहाल, यह आर्ग्युमेंट जैसा ही होगा. हालांकि, इसमें सर्वर से असाइन किए गए फ़ील्ड, जैसे कि expiryTime
और id
भरे हुए होंगे.
ध्यान दें कि expiryTime
या id
फ़ील्ड के लिए दी गई किसी भी वैल्यू को अनदेखा कर दिया जाएगा.
Classroom, cloudPubSubTopic
की पुष्टि कर सकता है और गड़बड़ियों की जानकारी दे सकता है. हालांकि, यह पक्का करना कॉलर की ज़िम्मेदारी है कि वह मौजूद है और Classroom के पास उस पर पब्लिश करने की अनुमति है.
इस तरीके से, गड़बड़ी के ये कोड दिख सकते हैं:
PERMISSION_DENIED
अगर:
- पुष्टि किए गए उपयोगकर्ता के पास, अनुरोध किए गए फ़ील्ड से सूचनाएं पाने की अनुमति नहीं है या
- मौजूदा उपयोगकर्ता ने अनुरोध किए गए फ़ीड के लिए, मौजूदा Cloud प्रोजेक्ट का ऐक्सेस नहीं दिया है. ध्यान दें कि फ़िलहाल, इस काम के लिए डोमेन-वाइड अधिकार देने की सुविधा उपलब्ध नहीं है. अगर अनुरोध का दायरा सही है, लेकिन कोई अनुदान मौजूद नहीं है, तो [अनुरोध से जुड़ी गड़बड़ियां][
@MissingGrant
गड़बड़ी] दिखती है.
- कोई दूसरी ऐक्सेस से जुड़ी गड़बड़ी आती है.
INVALID_ARGUMENT
अगर:
- कोई
cloudPubsubTopic
नहीं दिया गया है या दिया गया cloudPubsubTopic
अमान्य है; या
- कोई
feed
नहीं दिया गया है या दिया गया feed
अमान्य है.
NOT_FOUND
अगर:
- बताए गए
feed
को ढूंढा नहीं जा सकता या अनुरोध करने वाले उपयोगकर्ता के पास यह तय करने की अनुमति नहीं है कि यह मौजूद है या नहीं; या
- दिया गया
cloudPubsubTopic
ढूंढा नहीं जा सकता या Classroom को उस पर पब्लिश करने की अनुमति नहीं दी गई है.
एचटीटीपी अनुरोध
POST https://classroom.googleapis.com/v1/registrations
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Registration
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Registration
का नया इंस्टेंस शामिल किया जाता है.
अनुमति के दायरे
नीचे दिए गए OAuth के लिंक की ज़रूरत हाेती है:
https://www.googleapis.com/auth/classroom.push-notifications
ज़्यादा जानकारी के लिए, अनुमति से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# Method: registrations.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nCreates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`.\n\nReturns the created `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiryTime` and `id` filled in.\n\nNote that any value specified for the `expiryTime` or `id` fields will be ignored.\n\nWhile Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure that it exists and that Classroom has permission to publish to it.\n\nThis method may return the following error codes:\n\n- `PERMISSION_DENIED` if:\n - the authenticated user does not have permission to receive notifications from the requested field; or\n - the current user has not granted access to the current Cloud project with the appropriate scope for the requested feed. Note that domain-wide delegation of authority is not currently supported for this purpose. If the request has the appropriate scope, but no grant exists, a \\[Request Errors\\]\\[`@MissingGrant` error\\] is returned.\n - another [access error](/workspace/classroom/reference/Access.Errors) is encountered.\n- `INVALID_ARGUMENT` if:\n - no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or\n - no `feed` is specified, or the specified `feed` is not valid.\n- `NOT_FOUND` if:\n - the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not it exists; or\n - the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it.\n\n### HTTP request\n\n`POST https://classroom.googleapis.com/v1/registrations`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Registration](/workspace/classroom/reference/rest/v1/registrations#Registration).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Registration](/workspace/classroom/reference/rest/v1/registrations#Registration).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.push-notifications`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]