Patch

Updates one or more fields of an announcement

37 variables
34 variables

Updates one or more fields of an announcement.

This method returns the following error codes:

  • PERMISSION_DENIED if the requesting developer project did not create the corresponding announcement or for access errors.
  • INVALID_ARGUMENT if the request is malformed.
  • FAILED_PRECONDITION if the requested announcement has already been deleted.
  • NOT_FOUND if the requested course or announcement does not exist

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • View and manage announcements in Google Classroom

Input

This building block consumes 37 input parameters

  = Parameter name
  = Format

courseId STRING Required

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias

id STRING Required

Identifier of the announcement

updateMask ANY

Mask that identifies which fields on the announcement to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the Announcement object. If a field that does not support empty values is included in the update mask and not set in the Announcement object, an INVALID_ARGUMENT error will be returned.

The following fields may be specified by teachers:

  • text
  • state
  • scheduled_time

scheduledTime ANY

Optional timestamp when this announcement is scheduled to be published

creationTime ANY

Timestamp when this announcement was created.

Read-only

individualStudentsOptions OBJECT

Assignee details about a coursework/announcement. This field is set if and only if assigneeMode is INDIVIDUAL_STUDENTS

individualStudentsOptions.studentIds[] STRING

creatorUserId STRING

Identifier for the user that created the announcement.

Read-only

state ENUMERATION

Status of this announcement. If unspecified, the default state is DRAFT

text STRING

Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters

courseId STRING

Identifier of the course.

Read-only

id STRING

Classroom-assigned identifier of this announcement, unique per course.

Read-only

materials[] OBJECT

Material attached to course work.

When creating attachments, setting the form field is not supported

materials[].form OBJECT

Google Forms item

materials[].form.responseUrl STRING

URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form.

Read-only

materials[].form.formUrl STRING

URL of the form

materials[].form.title STRING

Title of the Form.

Read-only

materials[].form.thumbnailUrl STRING

URL of a thumbnail image of the Form.

Read-only

materials[].link OBJECT

URL item

materials[].link.title STRING

Title of the target of the URL.

Read-only

materials[].link.thumbnailUrl STRING

URL of a thumbnail image of the target URL.

Read-only

materials[].link.url STRING

URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters

materials[].youtubeVideo OBJECT

YouTube video item

materials[].youtubeVideo.thumbnailUrl STRING

URL of a thumbnail image of the YouTube video.

Read-only

materials[].youtubeVideo.id STRING

YouTube API resource ID

materials[].youtubeVideo.title STRING

Title of the YouTube video.

Read-only

materials[].youtubeVideo.alternateLink STRING

URL that can be used to view the YouTube video.

Read-only

materials[].driveFile OBJECT

Drive file that is used as material for course work

materials[].driveFile.driveFile OBJECT

Representation of a Google Drive file

materials[].driveFile.driveFile.alternateLink STRING

URL that can be used to access the Drive item.

Read-only

materials[].driveFile.driveFile.thumbnailUrl STRING

URL of a thumbnail image of the Drive item.

Read-only

materials[].driveFile.driveFile.id STRING

Drive API resource ID

materials[].driveFile.driveFile.title STRING

Title of the Drive item.

Read-only

materials[].driveFile.shareMode ENUMERATION

Mechanism by which students access the Drive item

updateTime ANY

Timestamp of the most recent change to this announcement.

Read-only

alternateLink STRING

Absolute link to this announcement in the Classroom web UI. This is only populated if state is PUBLISHED.

Read-only

assigneeMode ENUMERATION

Assignee mode of the announcement. If unspecified, the default value is ALL_STUDENTS

Output

This building block provides 34 output parameters

  = Parameter name
  = Format

scheduledTime ANY

Optional timestamp when this announcement is scheduled to be published

creationTime ANY

Timestamp when this announcement was created.

Read-only

individualStudentsOptions OBJECT

Assignee details about a coursework/announcement. This field is set if and only if assigneeMode is INDIVIDUAL_STUDENTS

individualStudentsOptions.studentIds[] STRING

creatorUserId STRING

Identifier for the user that created the announcement.

Read-only

state ENUMERATION

Status of this announcement. If unspecified, the default state is DRAFT

text STRING

Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters

courseId STRING

Identifier of the course.

Read-only

id STRING

Classroom-assigned identifier of this announcement, unique per course.

Read-only

materials[] OBJECT

Material attached to course work.

When creating attachments, setting the form field is not supported

materials[].form OBJECT

Google Forms item

materials[].form.responseUrl STRING

URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form.

Read-only

materials[].form.formUrl STRING

URL of the form

materials[].form.title STRING

Title of the Form.

Read-only

materials[].form.thumbnailUrl STRING

URL of a thumbnail image of the Form.

Read-only

materials[].link OBJECT

URL item

materials[].link.title STRING

Title of the target of the URL.

Read-only

materials[].link.thumbnailUrl STRING

URL of a thumbnail image of the target URL.

Read-only

materials[].link.url STRING

URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters

materials[].youtubeVideo OBJECT

YouTube video item

materials[].youtubeVideo.thumbnailUrl STRING

URL of a thumbnail image of the YouTube video.

Read-only

materials[].youtubeVideo.id STRING

YouTube API resource ID

materials[].youtubeVideo.title STRING

Title of the YouTube video.

Read-only

materials[].youtubeVideo.alternateLink STRING

URL that can be used to view the YouTube video.

Read-only

materials[].driveFile OBJECT

Drive file that is used as material for course work

materials[].driveFile.driveFile OBJECT

Representation of a Google Drive file

materials[].driveFile.driveFile.alternateLink STRING

URL that can be used to access the Drive item.

Read-only

materials[].driveFile.driveFile.thumbnailUrl STRING

URL of a thumbnail image of the Drive item.

Read-only

materials[].driveFile.driveFile.id STRING

Drive API resource ID

materials[].driveFile.driveFile.title STRING

Title of the Drive item.

Read-only

materials[].driveFile.shareMode ENUMERATION

Mechanism by which students access the Drive item

updateTime ANY

Timestamp of the most recent change to this announcement.

Read-only

alternateLink STRING

Absolute link to this announcement in the Classroom web UI. This is only populated if state is PUBLISHED.

Read-only

assigneeMode ENUMERATION

Assignee mode of the announcement. If unspecified, the default value is ALL_STUDENTS