Hiện tại, các nhà phát triển đã có thể sử dụng rộng rãi tiện ích bổ sung của Google Lớp học! Vui lòng xem tài liệu về tiện ích bổ sung để biết thêm thông tin.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mặc dù mọi nhà phát triển đều có thể gửi yêu cầu đến API Lớp học của Google, nhưng một số tính năng của Lớp học của Google chỉ dành cho một số người dùng nhất định. Mỗi tính năng có thể có các yêu cầu khác nhau, chẳng hạn như phải có một loại giấy phép Google Workspace for Education nhất định.
Để biết thông tin chi tiết về các tính năng ở từng cấp giấy phép Google Workspace for Education, hãy xem trang so sánh các phiên bản.
Các tính năng có điều kiện sử dụng
Các tính năng sau đây của API Lớp học chỉ dành cho người dùng đủ điều kiện:
Các yêu cầu gửi đến API Lớp học được thực hiện thay mặt cho từng người dùng.
Do đó, bạn nên kiểm tra xem người dùng có các chức năng phù hợp hay không trước khi đưa ra các yêu cầu API có yêu cầu về điều kiện.
Để xác định xem người dùng có một chức năng cụ thể hay không, hãy gửi một yêu cầu API đến phương thức checkUserCapability. Thêm loại Capability phù hợp cho tính năng Lớp học mà bạn dự định sử dụng. Chỉ định Capability thích hợp cho từng tính năng:
Để biết người dùng có...
Capability
Có thể tạo hoặc sửa đổi tệp đính kèm của tiện ích bổ sung Lớp học được liên kết với dự án trên Google Cloud của mã ứng dụng OAuth dùng để đưa ra yêu cầu
Tiếp theo, hãy kiểm tra trường allowed trong phản hồi. Nếu allowed là true, thì người dùng có quyền truy cập vào Capability đã chọn. Sau đó, bạn có thể đưa ra các yêu cầu API liên quan đến Capability thay mặt cho người dùng.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-01 UTC."],[],[],null,["# User eligibility\n\nWhile any developer can make requests to the Google Classroom API, some\nGoogle Classroom features are only available to certain users. Each feature\ncan have different requirements, such as having a certain Google Workspace for Education license type.\nFor a detailed breakdown of features at each Google Workspace for Education license level, see the\n[editions comparison page](//edu.google.com/intl/ALL_us/workspace-for-education/editions/compare-editions/).\n| **Key Term:** An **eligible** user has the **capability** to use a certain Classroom feature if they meet the feature requirements.\n| **Key Point:** Capability is determined separately for each user and can change over time. Capability eligibility for some features of the Classroom API might differ from the corresponding features in the Google Classroom app. For example, certain [license requirements](/workspace/classroom/rubrics/limitations#license-requirements) apply when creating, modifying, or deleting rubrics with the API.\n\nFeatures with eligibility requirements\n--------------------------------------\n\n\u003cbr /\u003e\n\nThe following Classroom API features are only available to eligible\nusers:\n\n- Creating and modifying [Classroom add-on](/workspace/classroom/add-ons) attachments.\n- Modifying [grading period settings](/workspace/classroom/grading-periods/manage-grading-periods#licensing_requirements).\n- Creating, modifying, and deleting [rubrics](/workspace/classroom/rubrics/limitations#license-requirements).\n\nDetermine user capabilities\n---------------------------\n\nRequests to Classroom API are made on behalf of individual users.\nTherefore, you should check whether a user has the appropriate capabilities\nbefore issuing API requests with eligibility requirements.\n| **Key Point:** Consider checking user capabilities proactively so you can tailor your product's appearance or behavior to match the Classroom features that they can access.\n\nTo determine whether a user has a particular capability, make an API request to\nthe [`checkUserCapability`](/workspace/classroom/reference/rest/v1/userProfiles/checkUserCapability) method. Include the appropriate [`Capability`](/workspace/classroom/reference/rest/v1/userProfiles/checkUserCapability#capability) type\nfor the Classroom feature you intend to use. Specify the\nappropriate `Capability` for each feature:\n\n| To see if the user... | `Capability` |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|\n| Can [create](/workspace/classroom/reference/rest/v1/courses.courseWork.addOnAttachments/create) or [modify](/workspace/classroom/reference/rest/v1/courses.courseWork.addOnAttachments/patch) a Classroom add-on attachment associated with the Google Cloud project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request | `CREATE_ADD_ON_ATTACHMENT` |\n| Can [modify](/workspace/classroom/reference/rest/v1/courses/updateGradingPeriodSettings) grading period settings | `UPDATE_GRADING_PERIOD_SETTINGS` |\n| Can [create](/workspace/classroom/reference/rest/v1/courses.courseWork.rubrics/create), [modify](/workspace/classroom/reference/rest/v1/courses.courseWork.rubrics/patch), or [delete](/workspace/classroom/reference/rest/v1/courses.courseWork.rubrics/delete) a rubric | `CREATE_RUBRIC` |\n\nNext, check the `allowed` field in the response. If `allowed` is `true`, then\nthe user has access to the chosen `Capability`. You can then make API requests\nrelated the `Capability` on behalf of the user.\n| **Important:** Even when a user is eligible, it's still possible for API requests that depend on the eligibility to fail. Eligibility implies that a user can make use of a Classroom feature, not that a specific request will succeed."]]