REST Resource: courses.announcements.addOnAttachments

Resource: AddOnAttachment

An add-on attachment on a post.

JSON representation
{
  "courseId": string,
  "postId": string,
  "itemId": string,
  "id": string,
  "title": string,
  "teacherViewUri": {
    object (EmbedUri)
  },
  "studentViewUri": {
    object (EmbedUri)
  },
  "studentWorkReviewUri": {
    object (EmbedUri)
  },
  "dueDate": {
    object (Date)
  },
  "dueTime": {
    object (TimeOfDay)
  },
  "maxPoints": number,
  "copyHistory": [
    {
      object (CopyHistory)
    }
  ]
}
Fields
courseId

string

Immutable. Identifier of the course.

postId
(deprecated)

string

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 (EmbedUri)

Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the courseId, postId, and attachmentId query parameters set.

studentViewUri

object (EmbedUri)

Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the courseId, postId, and attachmentId query parameters set.

studentWorkReviewUri

object (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, postId, attachmentId, and submissionId query parameters set. This is the same submissionId returned by [google.classroom.AddOns.GetAddOnContext][announcements.getAddOnContext] when a student views the attachment. If the URI is omitted or removed, maxPoints will also be discarded.

dueDate

object (Date)

Date, in UTC, that work on this attachment is due. This must be specified if dueTime is specified.

dueTime

object (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 (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

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

create

Creates an add-on attachment under a post.

delete

Deletes an add-on attachment.

get

Returns an add-on attachment.

list

Returns all attachments created by an add-on under the post.

patch

Updates an add-on attachment.