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.
Method: courses.announcements.modifyAssignees
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.
Sửa đổi chế độ người được giao và các lựa chọn của thông báo.
Chỉ giáo viên của khoá học có chứa thông báo mới có thể gọi phương thức này.
Phương thức này trả về các mã lỗi sau:
PERMISSION_DENIED
nếu người dùng yêu cầu không được phép truy cập vào khoá học hoặc bài tập trên lớp được yêu cầu hoặc đối với lỗi truy cập.
INVALID_ARGUMENT
nếu yêu cầu sai định dạng.
NOT_FOUND
nếu khoá học hoặc bài tập được yêu cầu không tồn tại.
FAILED_PRECONDITION
cho lỗi yêu cầu sau đây:
Yêu cầu HTTP
POST https://classroom.googleapis.com/v1/courses/{courseId}/announcements/{id}:modifyAssignees
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
courseId |
string
Giá trị nhận dạng của khoá học. Giá trị nhận dạng này có thể là giá trị nhận dạng do Lớp học chỉ định hoặc alias .
|
id |
string
Giá trị nhận dạng của thông báo.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Trường |
assigneeMode |
enum (AssigneeMode )
Chế độ của thông báo mô tả việc tất cả học viên hay chỉ một số học viên cụ thể có thể truy cập vào thông báo đó.
|
modifyIndividualStudentsOptions |
object (ModifyIndividualStudentsOptions )
Thiết lập những học viên có thể xem hoặc không thể xem thông báo. Bạn chỉ được chỉ định khi assigneeMode là INDIVIDUAL_STUDENTS .
|
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của Announcement
.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/classroom.announcements
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-26 UTC."],[],[],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nModifies assignee mode and options of an announcement.\n\nOnly a teacher of the course that contains the announcement may call this method.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if the request is malformed.\n- `NOT_FOUND` if the requested course or course work does not exist.\n- `FAILED_PRECONDITION` for the following [request error](/workspace/classroom/reference/Request.Errors):\n - EmptyAssignees\n\nHTTP request\n\n`POST https://classroom.googleapis.com/v1/courses/{courseId}/announcements/{id}:modifyAssignees`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Identifier of the course. This identifier can be either the Classroom-assigned identifier or an [alias](/workspace/classroom/reference/rest/v1/courses.aliases#CourseAlias). |\n| `id` | `string` Identifier of the announcement. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"assigneeMode\": enum (/workspace/classroom/reference/rest/v1/AssigneeMode), \"modifyIndividualStudentsOptions\": { object (/workspace/classroom/reference/rest/v1/ModifyIndividualStudentsOptions) } } ``` |\n\n| Fields ||\n|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `assigneeMode` | `enum (`[AssigneeMode](/workspace/classroom/reference/rest/v1/AssigneeMode)`)` Mode of the announcement describing whether it is accessible by all students or specified individual students. |\n| `modifyIndividualStudentsOptions` | `object (`[ModifyIndividualStudentsOptions](/workspace/classroom/reference/rest/v1/ModifyIndividualStudentsOptions)`)` Set which students can view or cannot view the announcement. Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. |\n\nResponse body\n\nIf successful, the response body contains an instance of [Announcement](/workspace/classroom/reference/rest/v1/courses.announcements#Announcement).\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/classroom.announcements`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]