REST Resource: courses

Resource: Course

A Course in Classroom.

JSON representation
{
  "id": string,
  "name": string,
  "section": string,
  "descriptionHeading": string,
  "description": string,
  "room": string,
  "ownerId": string,
  "creationTime": string,
  "updateTime": string,
  "enrollmentCode": string,
  "courseState": enum(CourseState),
  "alternateLink": string,
  "teacherGroupEmail": string,
  "courseGroupEmail": string,
  "teacherFolder": {
    object(DriveFolder)
  },
  "courseMaterialSets": [
    {
      object(CourseMaterialSet)
    }
  ],
  "guardiansEnabled": boolean,
  "calendarId": string
}
Fields
id

string

Identifier for this course assigned by Classroom.

When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The id is still assigned by Classroom and cannot be updated after the course is created.

Specifying this field in a course update mask results in an error.

name

string

Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string.

section

string

Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters.

descriptionHeading

string

Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters.

description

string

Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters.

room

string

Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters.

ownerId

string

The identifier of the owner of a course.

When specified as a parameter of a create course request, this field is required. The identifier can be one of the following:

  • the numeric identifier for the user
  • the email address of the user
  • the string literal "me", indicating the requesting user

This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only.

creationTime

string (Timestamp format)

Creation time of the course. Specifying this field in a course update mask results in an error.

Read-only.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Time of the most recent update to this course. Specifying this field in a course update mask results in an error.

Read-only.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

enrollmentCode

string

Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error.

Read-only.

courseState

enum(CourseState)

State of the course. If unspecified, the default state is PROVISIONED.

teacherGroupEmail

string

The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions.

Read-only.

courseGroupEmail

string

The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions.

Read-only.

teacherFolder

object(DriveFolder)

Information about a Drive Folder that is shared with all teachers of the course.

This field will only be set for teachers of the course and domain administrators.

Read-only.

courseMaterialSets[]

object(CourseMaterialSet)

Sets of materials that appear on the "about" page of this course.

Read-only.

guardiansEnabled

boolean

Whether or not guardian notifications are enabled for this course.

Read-only.

calendarId

string

The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course.

Read-only.

CourseState

Possible states a course can be in.

Enums
COURSE_STATE_UNSPECIFIED No course state. No returned Course message will use this value.
ACTIVE The course is active.
ARCHIVED The course has been archived. You cannot modify it except to change it to a different state.
PROVISIONED The course has been created, but not yet activated. It is accessible by the primary teacher and domain administrators, who may modify it or change it to the ACTIVE or DECLINED states. A course may only be changed to PROVISIONED if it is in the DECLINED state.
DECLINED The course has been created, but declined. It is accessible by the course owner and domain administrators, though it will not be displayed in the web UI. You cannot modify the course except to change it to the PROVISIONED state. A course may only be changed to DECLINED if it is in the PROVISIONED state.
SUSPENDED The course has been suspended. You cannot modify the course, and only the user identified by the ownerId can view the course. A course may be placed in this state if it potentially violates the Terms of Service.

CourseMaterialSet

A set of materials that appears on the "About" page of the course. These materials might include a syllabus, schedule, or other background information relating to the course as a whole.

JSON representation
{
  "title": string,
  "materials": [
    {
      object(CourseMaterial)
    }
  ]
}
Fields
title

string

Title for this set.

materials[]

object(CourseMaterial)

Materials attached to this set.

CourseMaterial

A material attached to a course as part of a material set.

JSON representation
{

  // Union field material can be only one of the following:
  "driveFile": {
    object(DriveFile)
  },
  "youTubeVideo": {
    object(YouTubeVideo)
  },
  "link": {
    object(Link)
  },
  "form": {
    object(Form)
  }
  // End of list of possible types for union field material.
}
Fields
Union field material. Material data. material can be only one of the following:
driveFile

object(DriveFile)

Google Drive file attachment.

youTubeVideo

object(YouTubeVideo)

Youtube video attachment.

form

object(Form)

Google Forms attachment.

Methods

create

Creates a course.

delete

Deletes a course.

get

Returns a course.

list

Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request.

patch

Updates one or more fields in a course.

update

Updates a course.

发送以下问题的反馈:

此网页
Classroom API
Classroom API
需要帮助?请访问我们的支持页面