You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="firstline">Returns an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or announcement, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or announcement does not exist.</p>
<pclass="firstline">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/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.</p>
<pclass="firstline">Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.</p>
<pre>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/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.
315
+
316
+
Args:
317
+
courseId: string, Required. Identifier of the course. (required)
318
+
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 post_id. (required)
319
+
addOnToken: string, Optional. Token that authorizes the request. The token is passed as a query parameter when the user is redirected from Classroom to the add-on's URL. The authorization token is required when neither of the following is true: * The add-on has attachments on the post. * The developer project issuing the request is the same project that created the post.
320
+
attachmentId: string, Optional. The identifier of the attachment. This field is required for student users and optional for teacher users. If not provided in the student case, an error is returned.
321
+
postId: string, Optional. Deprecated, use item_id instead.
322
+
x__xgafv: string, V1 error format.
323
+
Allowed values
324
+
1 - v1 error format
325
+
2 - v2 error format
326
+
327
+
Returns:
328
+
An object of the form:
329
+
330
+
{ # Attachment-relevant metadata for Classroom add-ons in the context of a specific post.
331
+
"courseId": "A String", # Immutable. Identifier of the course.
332
+
"itemId": "A String", # Immutable. Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached.
333
+
"postId": "A String", # Immutable. Deprecated, use item_id instead.
334
+
"studentContext": { # Role-specific context if the requesting user is a student. # 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.
335
+
"submissionId": "A 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`.
336
+
},
337
+
"supportsStudentWork": True or False, # Optional. Whether the post allows the teacher to see student work and passback grades.
338
+
"teacherContext": { # Role-specific context if the requesting user is a teacher. # 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.
<pre>Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
0 commit comments