গুগল ক্লাসরুম অ্যাড-অনগুলি এখন সাধারণত বিকাশকারীদের জন্য উপলব্ধ! আরও তথ্যের জন্য
অ্যাড-অন ডকুমেন্টেশন দেখুন.
কোর্সের আমন্ত্রণগুলি পরিচালনা করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ক্লাসরুমে একটি Invitation
সংস্থান একটি নির্দিষ্ট কোর্সের ভূমিকা সহ একটি কোর্সে যোগদানের জন্য একজন ব্যবহারকারীর জন্য একটি আমন্ত্রণ প্রতিনিধিত্ব করে: ছাত্র, শিক্ষক বা মালিক৷
প্রতিটি Invitation
সংস্থানে নিম্নলিখিত ক্ষেত্রগুলি রয়েছে:
-
id
: আমন্ত্রণের জন্য শ্রেণীকক্ষ-নির্ধারিত শনাক্তকারী। -
userId
: কোর্সে আমন্ত্রিত ব্যবহারকারীর আইডি। -
courseId
: যে কোর্সটিতে ব্যবহারকারীকে আমন্ত্রণ জানানো হচ্ছে। -
role
: কোর্সে আমন্ত্রিত ব্যবহারকারীর যে ভূমিকা থাকবে।
একটি আমন্ত্রণ তৈরি করুন
invitations.create()
পদ্ধতিটি একটি নির্দিষ্ট ভূমিকা সহ একটি কোর্সে একজন ব্যবহারকারীকে আমন্ত্রণ জানাতে ব্যবহার করা যেতে পারে। অনুরোধের অংশে Invitation
সংস্থান অন্তর্ভুক্ত করুন এবং courseId
, userId
এবং role
নির্দিষ্ট করুন।
একটি আমন্ত্রণ পুনরুদ্ধার করুন
invitations.get()
পদ্ধতিতে কল করে এবং আমন্ত্রণের id
উল্লেখ করে একটি নির্দিষ্ট আমন্ত্রণ পুনরুদ্ধার করুন।
একটি আমন্ত্রণ গ্রহণ করুন
একটি আমন্ত্রণ গ্রহণ করলে আমন্ত্রণটি মুছে যায় এবং আমন্ত্রিত ব্যবহারকারীকে আমন্ত্রণে নির্দিষ্ট ভূমিকা সহ কোর্সে যোগ করে। invitations.accept()
পদ্ধতিতে কল করে এবং আমন্ত্রণের id
উল্লেখ করে একটি আমন্ত্রণ গ্রহণ করুন।
একটি আমন্ত্রণ মুছুন
একটি আমন্ত্রণ আপডেট করার একমাত্র উপায় এটি মুছে ফেলা এবং একটি নতুন আমন্ত্রণ তৈরি করা৷ আমন্ত্রণটি মুছতে, invitations.delete()
পদ্ধতিতে কল করুন এবং id
নির্দিষ্ট করুন।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-01 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-01 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Manage Course Invitations\n\nAn [`Invitation` resource](/workspace/classroom/reference/rest/v1/invitations) in Classroom represents an invitation\nfor a user to join a course with a specific [course role](/workspace/classroom/reference/rest/v1/invitations#courserole): student, teacher,\nor owner.\n\nEach `Invitation` resource contains the following fields:\n\n- `id`: Classroom-assigned identifier for the invitation.\n- `userId`: The ID of the user that has been invited to the course.\n- `courseId`: The course that the user is being invited to.\n- `role`: The [course role](/workspace/classroom/reference/rest/v1/invitations#courserole) that the invited user will have in the course.\n\nCreate an Invitation\n--------------------\n\nThe [`invitations.create()`](/workspace/classroom/reference/rest/v1/invitations/create) method can be used to invite a user to a course\nwith a specific role. Include the [`Invitation` resource](/workspace/classroom/reference/rest/v1/invitations) in the request body\nand specify the `courseId`, `userId`, and `role`. \n\n### Java\n\nclassroom/snippets/src/main/java/CreateInvitation.java \n[View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/classroom/snippets/src/main/java/CreateInvitation.java) \n\n```java\nInvitation invitation = null;\ntry {\n /* Set the role the user is invited to have in the course. Possible values of CourseRole can be\n found here: https://developers.google.com/classroom/reference/rest/v1/invitations#courserole.*/\n Invitation content =\n new Invitation().setCourseId(courseId).setUserId(userId).setRole(\"TEACHER\");\n\n invitation = service.invitations().create(content).execute();\n\n System.out.printf(\n \"User (%s) has been invited to course (%s).\\n\",\n invitation.getUserId(), invitation.getCourseId());\n} catch (GoogleJsonResponseException e) {\n // TODO (developer) - handle error appropriately\n GoogleJsonError error = e.getDetails();\n if (error.getCode() == 404) {\n System.out.printf(\"The course or user does not exist.\\n\");\n }\n throw e;\n} catch (Exception e) {\n throw e;\n}\nreturn invitation;\n```\n\nRetrieve an Invitation\n----------------------\n\nRetrieve a specific invitation by calling the [`invitations.get()`](/workspace/classroom/reference/rest/v1/invitations/get) method\nand specifying the `id` of the invitation. \n\n### Java\n\nclassroom/snippets/src/main/java/GetInvitation.java \n[View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/classroom/snippets/src/main/java/GetInvitation.java) \n\n```java\nInvitation invitation = null;\ntry {\n invitation = service.invitations().get(id).execute();\n System.out.printf(\n \"Invitation (%s) for user (%s) in course (%s) retrieved.\\n\",\n invitation.getId(), invitation.getUserId(), invitation.getCourseId());\n} catch (GoogleJsonResponseException e) {\n GoogleJsonError error = e.getDetails();\n if (error.getCode() == 404) {\n System.out.printf(\"The invitation id (%s) does not exist.\\n\", id);\n }\n throw e;\n} catch (Exception e) {\n throw e;\n}\nreturn invitation;\n```\n\nAccept an Invitation\n--------------------\n\nAccepting an invitation deletes the invitation and adds the invited\nuser to the course with the role specified in the invitation. Accept an\ninvitation by calling the [`invitations.accept()`](/workspace/classroom/reference/rest/v1/invitations/accept) method and specifying the\n`id` of the invitation. \n\n### Java\n\nclassroom/snippets/src/main/java/AcceptInvitation.java \n[View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/classroom/snippets/src/main/java/AcceptInvitation.java) \n\n```java\ntry {\n service.invitations().accept(id).execute();\n System.out.printf(\"Invitation (%s) was accepted.\\n\", id);\n} catch (GoogleJsonResponseException e) {\n GoogleJsonError error = e.getDetails();\n if (error.getCode() == 404) {\n System.out.printf(\"The invitation id (%s) does not exist.\\n\", id);\n }\n throw e;\n} catch (Exception e) {\n throw e;\n}\n```\n\nDelete an Invitation\n--------------------\n\nThe only way to update an invitation is to delete it and create a new\ninvitation. To delete the invitation, call the [`invitations.delete()`](/workspace/classroom/reference/rest/v1/invitations/delete) method\nand specify the `id`. \n\n### Java\n\nclassroom/snippets/src/main/java/DeleteInvitation.java \n[View on GitHub](https://github.com/googleworkspace/java-samples/blob/main/classroom/snippets/src/main/java/DeleteInvitation.java) \n\n```java\ntry {\n service.invitations().delete(id).execute();\n System.out.printf(\"Invitation (%s) was deleted.\\n\", id);\n} catch (GoogleJsonResponseException e) {\n GoogleJsonError error = e.getDetails();\n if (error.getCode() == 404) {\n System.out.printf(\"The invitation id (%s) does not exist.\\n\", id);\n }\n throw e;\n} catch (Exception e) {\n throw e;\n}\n```"]]