通过 API Google 课堂获得 "subject" 课程价值

Getting "subject" value of course by API Google Classroom

如何获取或更新 API 中课程的“主题”值?我在文档中没有找到任何关于此的信息

https://developers.google.com/classroom/reference/rest/v1/courses/get?authuser=1

编辑

正如 R1KO 指出的那样,当您填写课程时,会有一个单独的主题字段。

但是,从下面courses对象的完整响应可以看出,在API中没有这个字段。

我已经呼叫了更多端点以查看它是否被埋在其他地方,但我找不到它。然而,查看问题跟踪器,揭示了这个功能请求:

Add Subject to Course

https://issuetracker.google.com/156289085

看来你现在能做的最好的事情就是点击那个功能中的 ☆ 按钮让 Google 知道你想要这个功能。


'subject'就是API

中的'name'

这是整个 courses 对象:

{
  "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
}

name字段说明如下:

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.

https://developers.google.com/classroom/reference/rest/v1/courses

您可以通过 GET 请求获得此信息:

https://developers.google.com/classroom/reference/rest/v1/courses/get

要获取上面列出的所有字段,请确保包含 * 作为字段参数。

更新 UPDATEPATCH:

https://developers.google.com/classroom/reference/rest/v1/courses/update https://developers.google.com/classroom/reference/rest/v1/courses/patch