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.
Không bắt buộc. Giá trị nhận dạng của bài đăng trong khoá học có tệp đính kèm cần liệt kê. Không dùng nữa, hãy sử dụng itemId.
Tham số truy vấn
Thông số
itemId
string
Giá trị nhận dạng của Announcement, CourseWork hoặc CourseWorkMaterial có tệp đính kèm cần được liệt kê. Đây là trường bắt buộc, nhưng không được đánh dấu là bắt buộc trong khi chúng tôi di chuyển từ postId.
pageSize
integer
Số lượng tệp đính kèm tối đa cần trả về. Dịch vụ có thể trả về ít hơn giá trị này. Nếu không chỉ định, hệ thống sẽ trả về tối đa 20 tệp đính kèm. Giá trị tối đa là 20; các giá trị trên 20 sẽ được chuyển đổi thành 20.
pageToken
string
Mã thông báo trang, nhận được từ lệnh gọi addOnAttachments.list trước đó. Cung cấp giá trị này để truy xuất trang tiếp theo.
Khi phân trang, tất cả các tham số khác được cung cấp cho addOnAttachments.list phải khớp với lệnh gọi đã cung cấp mã thông báo trang.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: courses.posts.addOnAttachments.list\n\n| This method is deprecated; use the `course.announcements.addOnAttachments`, `course.courseWork.addOnAttachments` or `course.courseWorkMaterials.addOnAttachments` method instead.\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nReturns all attachments created by an add-on under the post.\n\nRequires the add-on to have active attachments on the post or have permission to create new attachments on the post.\n\nThis method returns the following error codes:\n\n- `PERMISSION_DENIED` for [access errors](/workspace/classroom/reference/Access.Errors).\n- `INVALID_ARGUMENT` if the request is malformed.\n- `NOT_FOUND` if one of the identified resources does not exist.\n\n### HTTP request\n\n`GET https://classroom.googleapis.com/v1/courses/{courseId}/posts/{postId}/addOnAttachments`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `courseId` | `string` Required. Identifier of the course. |\n| `postId` **(deprecated)** | `string` Optional. Identifier of the post under the course whose attachments to enumerate. Deprecated, use `itemId` instead. |\n\n### Query parameters\n\n| Parameters ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `itemId` | `string` Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` whose attachments should be enumerated. This field is required, but is not marked as such while we are migrating from postId. |\n| `pageSize` | `integer` The maximum number of attachments to return. The service may return fewer than this value. If unspecified, at most 20 attachments will be returned. The maximum value is 20; values above 20 will be coerced to 20. |\n| `pageToken` | `string` A page token, received from a previous `addOnAttachments.list` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `addOnAttachments.list` must match the call that provided the page token. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [ListAddOnAttachmentsResponse](/workspace/classroom/reference/rest/v1/ListAddOnAttachmentsResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/classroom.addons.student`\n- `\n https://www.googleapis.com/auth/classroom.addons.teacher`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]