- [Resource: AddOnAttachment](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.SCHEMA_REPRESENTATION)
  - [EmbedUri](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri)
    - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri.SCHEMA_REPRESENTATION)
  - [CopyHistory](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.CopyHistory)
    - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.CopyHistory.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#METHODS_SUMMARY)

## Resource: AddOnAttachment

An add-on attachment on a post.

| JSON representation |
|---|
| ``` { "courseId": string, "postId": string, "itemId": string, "id": string, "title": string, "teacherViewUri": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`) }, "studentViewUri": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`) }, "studentWorkReviewUri": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`) }, "dueDate": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/Date`) }, "dueTime": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/TimeOfDay`) }, "maxPoints": number, "copyHistory": [ { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.CopyHistory`) } ] } ``` |

| Fields ||
|---|---|
| `courseId` | `string` Immutable. Identifier of the course. |
| `postId (deprecated)` | `string` > [!WARNING] > This item is deprecated! Immutable. Deprecated, use `itemId` instead. |
| `itemId` | `string` Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `id` | `string` Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `title` | `string` Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `teacherViewUri` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`)`` Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `studentViewUri` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`)`` Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `studentWorkReviewUri` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.EmbedUri`)`` URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `maxPoints` will also be discarded. |
| `dueDate` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/Date`)`` Date, in UTC, that work on this attachment is due. This must be specified if `dueTime` is specified. |
| `dueTime` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/TimeOfDay`)`` Time of day, in UTC, that work on this attachment is due. This must be specified if `dueDate` is specified. |
| `maxPoints` | `number` Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `copyHistory[]` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments#AddOnAttachment.CopyHistory`)`` Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |

### EmbedUri

URI to be iframed after being populated with query parameters.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` Required. URI to be iframed after being populated with query parameters. This must be a valid UTF-8 string containing between 1 and 1800 characters. |

### CopyHistory

Identifier of a previous copy of a given attachment.

| JSON representation |
|---|
| ``` { "courseId": string, "postId": string, "itemId": string, "attachmentId": string } ``` |

| Fields ||
|---|---|
| `courseId` | `string` Immutable. Identifier of the course. |
| `postId (deprecated)` | `string` > [!WARNING] > This item is deprecated! Immutable. Deprecated, use `itemId` instead. |
| `itemId` | `string` Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |
| `attachmentId` | `string` Immutable. Identifier of the attachment. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments/create` | Creates an add-on attachment under a post. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments/delete` | Deletes an add-on attachment. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments/get` | Returns an add-on attachment. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments/list` | Returns all attachments created by an add-on under the post. |
| ### `https://developers.google.com/workspace/classroom/reference/rest/v1/courses.announcements.addOnAttachments/patch` | Updates an add-on attachment. |