【问题标题】:Getting "subject" value of course by API Google Classroom通过 API Google Classroom 获取课程的“主题”价值
【发布时间】:2021-04-09 09:30:09
【问题描述】:

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

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

【问题讨论】:

    标签: google-classroom


    【解决方案1】:

    编辑

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

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

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

    Add Subject to Course

    https://issuetracker.google.com/156289085

    因此,此时您最好的办法就是点击该功能中的 ☆ 按钮,让 Google 知道您需要此功能。


    “主题”是 API 中的“名称”

    这是整个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字段说明如下:

    课程名称。例如,“10 年级生物学”。名称是必需的。它必须介于 1 到 750 个字符之间,并且是有效的 UTF-8 字符串。

    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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-28
    • 1970-01-01
    • 1970-01-01
    • 2021-02-21
    • 1970-01-01
    相关资源
    最近更新 更多