---
title: "GET /v1/courses/{courseId}/announcements/{itemId}/addOnContext"
method: GET
path: "/v1/courses/{courseId}/announcements/{itemId}/addOnContext"
tags: ["courses"]
---

# GET /v1/courses/{courseId}/announcements/{itemId}/addOnContext

`GET /v1/courses/{courseId}/announcements/{itemId}/addOnContext`

## Request

- Base URL: `https://classroom.googleapis.com`
- URL: `https://classroom.googleapis.com/v1/courses/{courseId}/announcements/{itemId}/addOnContext`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/classroom.addons.student`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/classroom.addons.student`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/classroom.addons.teacher`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/classroom.addons.teacher`

Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/workspace/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist.

## Path parameters

- `courseId` string, required
- `itemId` string, required

## Query parameters

- `addOnToken` string
- `attachmentId` string
- `postId` string

## Response `200`

Successful response

- AddOnContext: Attachment-relevant metadata for Classroom add-ons in the context of a specific post.
  - `courseId` string: Immutable. Identifier of the course.
  - `itemId` string: Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached.
  - `postId` string: Immutable. Deprecated, use `item_id` instead.
  - `studentContext` StudentContext: Role-specific context if the requesting user is a student.
    - `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`.
  - `supportsStudentWork` boolean: Optional. Whether the post allows the teacher to see student work and passback grades.
  - `teacherContext` TeacherContext: Role-specific context if the requesting user is a teacher.

## Changes

- **2026-11-02** `d9e82ce809f1`: 4 info
  - the security scope `https://www.googleapis.com/auth/classroom.addons.student` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.student` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.teacher` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.teacher` was removed from the endpoint's security scheme `Oauth2c`
- **2026-10-20** `8575901d0ec9`: 4 info
  - the security scope `https://www.googleapis.com/auth/classroom.addons.student` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.student` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.teacher` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/classroom.addons.teacher` was removed from the endpoint's security scheme `Oauth2c`
- …earlier changes not shown

[Operation history](https://skmtc.dev/google/apis/classroom/changes/v1/courses/:courseId/announcements/:itemId/addOnContext/get.md)

---

[API](https://skmtc.dev/google/apis/classroom.md) - [All operations](https://skmtc.dev/google/apis/classroom/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/classroom/revisions/d9e82ce809f1?raw)
