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.
Tổng quan
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.
API Google Lớp học cung cấp một giao diện lập trình để các nhà phát triển phần mềm, quản trị viên và lãnh đạo trường học quản lý các tài nguyên của Google Lớp học. Bạn có thể tạo phần mềm để tạo, truy xuất và sửa đổi các khoá học trên Lớp học cũng như nội dung của các khoá học đó.
Sau đây là một số trường hợp sử dụng thường gặp:
- Quản lý khoá học, danh sách và người giám hộ
- Thêm bài tập, thông báo và tài liệu khoá học
- Chấm điểm và sửa đổi chế độ cài đặt chấm điểm
- Tạo dữ liệu để phân tích
- Giúp người dùng khám phá và truy cập vào nội dung hoặc công cụ của một nhà cung cấp bên ngoài trong Lớp học
API Lớp học có phải là giải pháp phù hợp với tôi không?
Google cung cấp một số sản phẩm giúp bạn tương tác với Lớp học. Sau đây là một số trường hợp phổ biến và đề xuất về những sản phẩm có thể phù hợp nhất với nhu cầu của bạn.
Sửa đổi tài nguyên trên Google Lớp học
Trường hợp |
Giải pháp đề xuất |
Tôi muốn thường xuyên quản lý một số lượng lớn các khoá học, người dùng hoặc các tài nguyên khác trong Lớp học. Tôi có thể viết mã và duy trì cơ sở hạ tầng phần mềm. |
Viết các ứng dụng sử dụng API Lớp học.
|
Tôi muốn thỉnh thoảng quản lý một số ít tài nguyên trên Lớp học. Tôi có thể viết một lượng nhỏ mã mà không tốn nhiều công sức. |
Sử dụng Classroom API với Google Apps Script.
|
Tôi muốn thỉnh thoảng chỉnh sửa từng tài nguyên trong Lớp học. Tôi quen làm việc với các lệnh trên thiết bị đầu cuối. |
Sử dụng Trình quản lý Google Apps.
|
Tôi muốn có một số lượng lớn báo cáo có thông tin chi tiết về các sự kiện trong Lớp học. |
Sử dụng Dịch vụ chuyển dữ liệu của BigQuery.
|
Tôi muốn điều tra hoạt động của người dùng.
|
Tạo báo cáo trong Bảng điều khiển dành cho quản trị viên hoặc sử dụng Reports API. |
Tích hợp với Google Lớp học
Trường hợp |
Giải pháp đề xuất |
Tôi muốn giáo viên và học viên xem và chạy nội dung của tôi trong Lớp học. |
Tạo một tiện ích bổ sung cho Lớp học.
|
Tôi muốn giáo viên nhấp vào một nút trên trang web hoặc ứng dụng của tôi để nhúng nội dung của tôi vào Classroom. |
Tạo một tiện ích bổ sung Lớp học và tạo tệp đính kèm theo phương thức lập trình. |
Tôi muốn giáo viên nhấp vào một nút trên trang web hoặc ứng dụng của tôi để liên kết đến nội dung của tôi trong Lớp học.
|
Tạo bài tập trên lớp bằng API Lớp học hoặc nhúng các nút Chia sẻ với Lớp học. |
Tôi muốn giáo viên Lớp học đồng bộ hoá hoặc nhập thông tin từ Hệ thống thông tin học sinh của tôi. |
Triển khai OneRoster cho SIS hoặc tạo và truy cập vào các tài nguyên bằng API Lớp học.
|
Bắt đầu
Nhà phát triển mới nên làm những việc sau trước khi bắt đầu một dự án mới:
Để bắt đầu phát triển, hãy đảm bảo bạn đã hoàn tất các bước tiên quyết.
Chọn phạm vi Classroom API phù hợp với nhu cầu của bạn, sau đó thiết lập môi trường và bắt đầu đưa ra các yêu cầu bằng cách làm theo một trong các hướng dẫn bắt đầu nhanh:
Thử nghiệm bằng Google APIs Explorer
Để thử nghiệm các phương thức gọi trên dữ liệu trực tiếp, hãy thử dùng Google APIs Explorer. Bạn không cần viết mã để bắt đầu, nhưng hãy lưu ý rằng những thao tác bạn thực hiện bằng Trình khám phá API có thể sửa đổi dữ liệu hiện có.
Một cách để bắt đầu gọi các phương thức là gọi phương thức courses.list()
. Phương thức này không yêu cầu tham số yêu cầu nào và bạn có thể truy xuất một id
từ danh sách khoá học được trả về để dùng làm tham số yêu cầu cho các lệnh gọi API khác. Nếu chưa có khoá học nào, bạn có thể tạo một khoá học bằng phương thức courses.create()
.
Bạn cũng có thể khám phá tài liệu tham khảo về API Lớp học.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-01 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-01 UTC."],[],[],null,["# Overview\n\nThe Google Classroom API provides a programming interface for software developers,\nadministrators, and school leaders to manage Google Classroom resources. You\ncan build software that creates, retrieves, and modifies\nClassroom courses and their content.\n\nSome typical use cases include:\n\n- Managing courses, rosters, and guardians\n- Adding assignments, announcements, and course materials\n- Assigning grades and modifying grading settings\n- Generating data for analysis\n- Making content or tools from an outside provider discoverable and accessible within Classroom\n\n| **Note:** Some Classroom API features are only available to users with particular Google Workspace for Education [license types](//edu.google.com/intl/ALL_us/workspace-for-education/editions/compare-editions/). See the [user eligibility](/workspace/classroom/guides/key-concepts/user-eligibility) guide for more information.\n\nIs the Classroom API the right solution for me?\n-----------------------------------------------\n\nGoogle provides several products to help you interact with\nClassroom. The following are some common scenarios and\nrecommendations for products that might best fit your needs.\n\n### Modify Google Classroom resources\n\n| Scenario | Recommended solutions |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| I want to regularly manage a high volume of courses, users, or other Classroom resources. I am comfortable writing code and maintaining software infrastructure. | Write applications that use Classroom API. |\n| I want to occasionally manage a small volume of Classroom resources. I am comfortable writing small amounts of code with little overhead. | Use Classroom API with [Google Apps Script](https://developers.google.com/apps-script). |\n| I want to occasionally make changes to individual Classroom resources. I am comfortable working with terminal commands. | Use [Google Apps Manager](//github.com/GAM-team/GAM). |\n| I want a large volume of reports with details about events in Classroom. | Use BigQuery [Data Transfer Service](//cloud.google.com/bigquery/docs/dts-introduction). |\n| I want to conduct an investigation into my users' activity. | Generate reports in the [Admin console](//admin.google.com/ac/reporting/home) or use the [Reports API](/admin-sdk/reports/v1/get-start/overview). |\n\n### Integrate with Google Classroom\n\n| Scenario | Recommended solutions |\n|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| I want teachers and students to see and launch my content in Classroom. | Build a [Classroom add-on](/workspace/classroom/add-ons). |\n| I want teachers to click a button on my website or app that embeds my content in Classroom. | Build a [Classroom add-on](/workspace/classroom/add-ons) and [create attachments](/workspace/classroom/add-ons/developer-guides/third-party-first-journey) programmatically. |\n| I want teachers to click a button on my website or app to link to my content in Classroom. | [Create coursework](/workspace/classroom/guides/coursework-integration) using Classroom API or embed [Share to Classroom](/workspace/classroom/guides/sharebutton) buttons. |\n| I want Classroom teachers to sync with or import information from my Student Information System. | Implement [OneRoster for SIS](/workspace/classroom/sis-integrations/getting-started) or create and access resources using Classroom API. |\n\nGetting started\n---------------\n\nNew developers are encouraged to do the following before starting a new project:\n\n- Read our guide on [Classroom API structure](/workspace/classroom/guides/key-concepts/api-structure).\n- Read about [grades](/workspace/classroom/guides/key-concepts/grades), [user types](/workspace/classroom/guides/key-concepts/user-types), [user eligibility](/workspace/classroom/guides/key-concepts/user-eligibility), and [administrator\n actions](/workspace/classroom/guides/key-concepts/admin-actions). These guides explain concepts unique to Google Classroom and Classroom API.\n- Understand [how Classroom API requests work](/workspace/classroom/guides/onboarding/how-requests-work).\n\nTo begin developing, ensure that you have completed the [prerequisite steps](/workspace/classroom/guides/onboarding/prerequisites).\nChoose the appropriate [Classroom API scopes](/workspace/classroom/guides/auth) for your needs, then set up your\nenvironment and begin making requests by following one of the quickstarts:\n\n- [Go](/workspace/classroom/quickstart/go)\n- [Google Apps Script](/workspace/classroom/quickstart/apps-script)\n- [Java](/workspace/classroom/quickstart/java)\n- [JavaScript](/workspace/classroom/quickstart/js)\n- [Node.js](/workspace/classroom/quickstart/nodejs)\n- [Python](/workspace/classroom/quickstart/python)\n\n### Experiment with the Google APIs Explorer\n\nTo experiment calling methods on live data, try using the [Google APIs\nExplorer](/workspace/explore?filter=&discoveryUrl=https%3A%2F%2Fclassroom.googleapis.com%2F%24discovery%2Frest%3Fversion%3Dv1&discoveryRef=). You don't have to write any code to get started, but be aware that\nactions you perform using the APIs Explorer can modify existing data.\n\nOne way to start calling the methods is to call the [`courses.list()`](/workspace/explore?filter=&discoveryUrl=https%3A%2F%2Fclassroom.googleapis.com%2F%24discovery%2Frest%3Fversion%3Dv1&discoveryRef=resources.courses.methods.list&operationId=classroom.courses.list)\nmethod. This method does not require any request parameters and you can retrieve\nan `id` from the returned list of courses to use as the request parameter for\nother API calls. If you don't have any courses, you can create one using the\n[`courses.create()`](/workspace/explore?filter=&discoveryUrl=https%3A%2F%2Fclassroom.googleapis.com%2F%24discovery%2Frest%3Fversion%3Dv1&discoveryRef=resources.courses.methods.create&operationId=classroom.courses.create) method.\n\nYou can also explore the [Classroom API reference](/workspace/classroom/reference/rest)."]]