ส่วนเสริมของ Google Classroom พร้อมให้บริการแก่นักพัฒนาซอฟต์แวร์แล้ว โปรดดูข้อมูลเพิ่มเติมใน
เอกสารส่วนเสริม
Method: courses.announcements.addOnAttachments.get
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงผลไฟล์แนบของส่วนเสริม
กำหนดให้ส่วนเสริมที่ขอไฟล์แนบเป็นผู้สร้างไฟล์แนบเดิม
วิธีการนี้จะแสดงรหัสข้อผิดพลาดต่อไปนี้
PERMISSION_DENIED
สำหรับข้อผิดพลาดในการเข้าถึง
INVALID_ARGUMENT
หากคำขอมีรูปแบบไม่ถูกต้อง
NOT_FOUND
หากทรัพยากรที่ระบุไม่อยู่
คำขอ HTTP
GET https://classroom.googleapis.com/v1/courses/{courseId}/announcements/{itemId}/addOnAttachments/{attachmentId}
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
courseId |
string
ต้องระบุ ตัวระบุของหลักสูตร
|
itemId |
string
ตัวระบุของ Announcement , CourseWork หรือ CourseWorkMaterial ที่แนบไฟล์แนบ คุณต้องกรอกข้อมูลในช่องนี้ แต่ไม่ได้ระบุว่าเป็นช่องที่ต้องกรอกขณะที่เราย้ายข้อมูลจาก postId
|
attachmentId |
string
ต้องระบุ ตัวระบุของไฟล์แนบ
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
postId (deprecated) |
string
ไม่บังคับ เลิกใช้งานแล้ว โปรดใช้ itemId แทน
|
เนื้อความของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ AddOnAttachment
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/classroom.addons.student
https://www.googleapis.com/auth/classroom.addons.teacher
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Method: courses.announcements.addOnAttachments.get\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 an add-on attachment.\n\nRequires the add-on requesting the attachment to be the original creator of the attachment.\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}/announcements/{itemId}/addOnAttachments/{attachmentId}`\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| `itemId` | `string` Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. This field is required, but is not marked as such while we are migrating from postId. |\n| `attachmentId` | `string` Required. Identifier of the attachment. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------|------------------------------------------------------|\n| `postId` **(deprecated)** | `string` Optional. Deprecated, use `itemId` instead. |\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 [AddOnAttachment](/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment).\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)."]]