ส่วนเสริมของ Google Classroom พร้อมให้บริการแก่นักพัฒนาซอฟต์แวร์แล้ว โปรดดูข้อมูลเพิ่มเติมใน
เอกสารส่วนเสริม
REST Resource: invitations
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แหล่งข้อมูล: คำเชิญ
คำเชิญให้เข้าร่วมหลักสูตร
การแสดง JSON |
{
"id": string,
"userId": string,
"courseId": string,
"role": enum (CourseRole )
} |
ช่อง |
id |
string
ตัวระบุที่กำหนดโดย Classroom อ่านอย่างเดียว
|
userId |
string
ตัวระบุของผู้ใช้ที่ได้รับเชิญ เมื่อระบุเป็นตัวแปรบของคําขอ คุณสามารถตั้งค่าตัวระบุนี้เป็นค่าใดค่าหนึ่งต่อไปนี้
- ตัวระบุตัวเลขของผู้ใช้
- อีเมลของผู้ใช้
- สตริงตามตัวอักษร
"me" ที่ระบุผู้ใช้ที่ส่งคำขอ
|
courseId |
string
ตัวระบุของหลักสูตรที่จะเชิญผู้ใช้
|
role |
enum (CourseRole )
บทบาทที่จะมอบหมายให้ผู้ใช้ ต้องไม่ใช่ COURSE_ROLE_UNSPECIFIED
|
CourseRole
บทบาทที่เป็นไปได้ที่ผู้ใช้อาจได้รับเชิญให้รับ
Enum |
COURSE_ROLE_UNSPECIFIED |
ไม่มีบทบาทในหลักสูตร |
STUDENT |
นักเรียนในหลักสูตร |
TEACHER |
ครูของหลักสูตร |
OWNER |
เจ้าของหลักสูตร |
เมธอด |
|
ยอมรับคำเชิญ นำคำเชิญออก และเพิ่มผู้ใช้ที่ได้รับเชิญเป็นครูหรือนักเรียน (ตามความเหมาะสม) ของหลักสูตรที่ระบุ |
|
สร้างคำเชิญ |
|
ลบคำเชิญ |
|
แสดงผลคำเชิญ |
|
แสดงรายการคำเชิญที่ผู้ใช้ที่ส่งคำขอได้รับอนุญาตให้ดู โดยจำกัดไว้เฉพาะคำเชิญที่ตรงกับคำขอรายการ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# REST Resource: invitations\n\n- [Resource: Invitation](#Invitation)\n - [JSON representation](#Invitation.SCHEMA_REPRESENTATION)\n- [CourseRole](#CourseRole)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Invitation\n--------------------\n\nAn invitation to join a course.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"userId\": string, \"courseId\": string, \"role\": enum (/workspace/classroom/reference/rest/v1/invitations#CourseRole) } ``` |\n\n| Fields ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier assigned by Classroom. Read-only. |\n| `userId` | `string` Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to 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| `courseId` | `string` Identifier of the course to invite the user to. |\n| `role` | `enum (`[CourseRole](/workspace/classroom/reference/rest/v1/invitations#CourseRole)`)` Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |\n\nCourseRole\n----------\n\nPossible roles a user may be invite to have.\n\n| Enums ||\n|---------------------------|------------------------|\n| `COURSE_ROLE_UNSPECIFIED` | No course role. |\n| `STUDENT` | Student in the course. |\n| `TEACHER` | Teacher of the course. |\n| `OWNER` | Owner of the course. |\n\n| Methods ------- ||\n|-------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| ### [accept](/workspace/classroom/reference/rest/v1/invitations/accept) | Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. |\n| ### [create](/workspace/classroom/reference/rest/v1/invitations/create) | Creates an invitation. |\n| ### [delete](/workspace/classroom/reference/rest/v1/invitations/delete) | Deletes an invitation. |\n| ### [get](/workspace/classroom/reference/rest/v1/invitations/get) | Returns an invitation. |\n| ### [list](/workspace/classroom/reference/rest/v1/invitations/list) | Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. |"]]