返回顶部
g

google-classroom谷歌教室

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
783
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

google-classroom

Google Classroom

通过托管OAuth认证访问Google Classroom API。管理课程、课程作业、学生、教师、公告和提交内容。

快速开始

bash

列出所有课程


python3 < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-classroom/v1/courses)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础URL

https://gateway.maton.ai/google-classroom/{api-path}

Google Classroom API使用以下路径模式:

https://gateway.maton.ai/google-classroom/v1/{resource}

认证

所有请求都需要在Authorization头部中包含Maton API密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的API密钥设置为MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取您的API密钥

  1. 1. 在maton.ai登录或创建账户
  2. 前往maton.ai/settings
  3. 复制您的API密钥

连接管理

在https://ctrl.maton.ai管理您的Google Classroom OAuth连接。

列出连接

bash
python3 < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=google-classroom&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python3 < import urllib.request, os, json
data = json.dumps({app: google-classroom}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python3 < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: 8efa1361-0e86-40b1-a63b-53a5051f8ac6,
status: ACTIVE,
creation_time: 2026-02-14T00:00:00.000000Z,
lastupdatedtime: 2026-02-14T00:00:00.000000Z,
url: https://connect.maton.ai/?session_token=...,
app: google-classroom,
metadata: {}
}
}

在浏览器中打开返回的url以完成OAuth授权。

删除连接

bash
python3 < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个Google Classroom连接,请使用Maton-Connection头部指定要使用的连接:

bash
python3 < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/google-classroom/v1/courses)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, 8efa1361-0e86-40b1-a63b-53a5051f8ac6)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最旧的)活动连接。

API参考

课程

列出课程

bash
GET /v1/courses
GET /v1/courses?courseStates=ACTIVE
GET /v1/courses?teacherId=me
GET /v1/courses?studentId=me
GET /v1/courses?pageSize=10

查询参数:

  • - courseStates - 按状态筛选:ACTIVE、ARCHIVED、PROVISIONED、DECLINED、SUSPENDED
  • teacherId - 按教师ID筛选(使用me表示当前用户)
  • studentId - 按学生ID筛选(使用me表示当前用户)
  • pageSize - 每页结果数(最多100)
  • pageToken - 下一页的令牌

响应:
json
{
courses: [
{
id: 825635865485,
name: 编程入门,
section: A班,
descriptionHeading: CS 101,
description: 学习编程基础知识,
ownerId: 102753038276005039640,
creationTime: 2026-02-14T01:53:58.991Z,
updateTime: 2026-02-14T01:53:58.991Z,
enrollmentCode: 3qsua37m,
courseState: ACTIVE,
alternateLink: https://classroom.google.com/c/ODI1NjM1ODY1NDg1,
guardiansEnabled: false
}
],
nextPageToken: ...
}

获取课程

bash
GET /v1/courses/{courseId}

创建课程

bash
POST /v1/courses
Content-Type: application/json

{
name: 课程名称,
section: A班,
descriptionHeading: 课程标题,
description: 课程描述,
ownerId: me
}

响应:
json
{
id: 825637533405,
name: 课程名称,
section: A班,
ownerId: 102753038276005039640,
courseState: PROVISIONED,
enrollmentCode: abc123
}

更新课程

bash
PATCH /v1/courses/{courseId}?updateMask=name,description
Content-Type: application/json

{
name: 更新后的课程名称,
description: 更新后的描述
}

注意: 使用updateMask查询参数指定要更新的字段。

删除课程

bash
DELETE /v1/courses/{courseId}

注意: 删除前必须先归档课程。要归档,请使用courseState: ARCHIVED更新课程。

课程作业(作业)

列出课程作业

bash
GET /v1/courses/{courseId}/courseWork
GET /v1/courses/{courseId}/courseWork?courseWorkStates=PUBLISHED
GET /v1/courses/{courseId}/courseWork?orderBy=dueDate

查询参数:

  • - courseWorkStates - 按状态筛选:PUBLISHED、DRAFT、DELETED
  • orderBy - 排序方式:dueDate、updateTime
  • pageSize - 每页结果数
  • pageToken - 下一页的令牌

获取课程作业

bash
GET /v1/courses/{courseId}/courseWork/{courseWorkId}

创建课程作业

bash
POST /v1/courses/{courseId}/courseWork
Content-Type: application/json

{
title: 作业标题,
description: 作业描述,
workType: ASSIGNMENT,
state: PUBLISHED,
maxPoints: 100,
dueDate: {
year: 2026,
month: 3,
day: 15
},
dueTime: {
hours: 23,
minutes: 59
}
}

作业类型:

  • - ASSIGNMENT - 常规作业
  • SHORTANSWERQUESTION - 简答题
  • MULTIPLECHOICEQUESTION - 选择题

状态:

  • - DRAFT - 对学生不可见
  • PUBLISHED

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-classroom-1776420049 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-classroom-1776420049 技能

通过命令行安装

skillhub install google-classroom-1776420049

下载

⬇ 下载 google-classroom v1.0.2(免费)

文件大小: 5.75 KB | 发布时间: 2026-4-17 19:22

v1.0.2 最新 2026-4-17 19:22
- No changes detected in this release; documentation and implementation remain unchanged.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部