- [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#SCHEMA_REPRESENTATION)
- [StudentContext](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext)
  - [JSON representation](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext.SCHEMA_REPRESENTATION)
- [TeacherContext](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#TeacherContext)

Attachment-relevant metadata for Classroom add-ons in the context of a specific post.

| JSON representation |
|---|
| ``` { "courseId": string, "postId": string, "itemId": string, "supportsStudentWork": boolean, "studentContext": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext`) }, "teacherContext": { object (`https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#TeacherContext`) } } ``` |

| 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. |
| `supportsStudentWork` | `boolean` Optional. Whether the post allows the teacher to see student work and passback grades. |
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `studentContext` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext`)`` Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |
| `teacherContext` | ``object (`https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#TeacherContext`)`` Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |
| End of mutually exclusive fields. ||

## StudentContext

Role-specific context if the requesting user is a student.

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

| Fields ||
|---|---|
| `submissionId` | `string` Requesting user's submission id to be used for grade passback and to identify the student when showing student work to the teacher. This is set exactly when `supportsStudentWork` is `true`. |

## TeacherContext

This type has no fields.
Role-specific context if the requesting user is a teacher.