上课码
上课码按课堂签发,可使用 teacher 或 student 角色。maxClaims 必填。老师码的领用上限为 1;批量签发学生专属码时,每张码的领用上限为 1。列表返回当前状态、领用数量和领用用户。update 可以修改备注、领用上限或轮换码值;revoke 撤销上课码。
应用后端使用应用业务接口和应用凭证。本页描述独立的租户管理调用。
entryCodes.list
上课码及领用记录。
GET /v1/classrooms/entry-codes
鉴权:租户 Bearer Token 与 x-app-id。
| 语言 | 调用 |
|---|---|
| Node.js | c.entryCodes.list(appId, input) |
| Python | c.entry_codes.list(app_id, **input) |
| Java | c.entryCodes.list(appId, input) |
| Go | c.EntryCodes.List(ctx, appID, input, &result) |
| PHP | $c->entryCodes->list($appId, $input) |
输入:ClassroomIdInput。 字段放在 URL 查询参数中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
classroomId | 是 | string | 课堂 ID |
返回:EntryCodeList。嵌套字段见共享类型。
entryCodes.issue
签发上课码。
POST /v1/classrooms/entry-codes
鉴权:租户 Bearer Token 与 x-app-id。
| 语言 | 调用 |
|---|---|
| Node.js | c.entryCodes.issue(appId, input) |
| Python | c.entry_codes.issue(app_id, **input) |
| Java | c.entryCodes.issue(appId, input) |
| Go | c.EntryCodes.Issue(ctx, appID, input, &result) |
| PHP | $c->entryCodes->issue($appId, $input) |
输入:IssueEntryCodesInput。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
role | 是 | "teacher" | "student" | 成员或上课码角色 |
maxClaims | 是 | number | 最多领用人数,1–500;老师码为 1 |
count | 否 | number | undefined | 签发数量,1–20;老师码按 1 张处理 |
remark | 否 | string | undefined | 备注,最多 64 字符 |
classroomId | 是 | string | 课堂 ID |
返回:EntryCodeList。嵌套字段见共享类型。
entryCodes.update
修改或轮换上课码。
POST /v1/classrooms/entry-codes/update
鉴权:租户 Bearer Token 与 x-app-id。
| 语言 | 调用 |
|---|---|
| Node.js | c.entryCodes.update(appId, input) |
| Python | c.entry_codes.update(app_id, **input) |
| Java | c.entryCodes.update(appId, input) |
| Go | c.EntryCodes.Update(ctx, appID, input, &result) |
| PHP | $c->entryCodes->update($appId, $input) |
输入:UpdateEntryCodeInput。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
entryCodeId | 是 | string | 上课码记录 ID |
maxClaims | 否 | number | undefined | 最多领用人数,1–500;老师码为 1 |
remark | 否 | string | undefined | 备注,最多 64 字符 |
rotate | 否 | boolean | undefined | 轮换上课码值 |
classroomId | 是 | string | 课堂 ID |
返回:EntryCodeRecord。嵌套字段见共享类型。
entryCodes.revoke
撤销上课码。
POST /v1/classrooms/entry-codes/revoke
鉴权:租户 Bearer Token 与 x-app-id。
| 语言 | 调用 |
|---|---|
| Node.js | c.entryCodes.revoke(appId, input) |
| Python | c.entry_codes.revoke(app_id, **input) |
| Java | c.entryCodes.revoke(appId, input) |
| Go | c.EntryCodes.Revoke(ctx, appID, input, &result) |
| PHP | $c->entryCodes->revoke($appId, $input) |
输入:RevokeEntryCodeInput。 字段放在 JSON Body 中。
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
entryCodeId | 是 | string | 上课码记录 ID |
classroomId | 是 | string | 课堂 ID |
返回:EntryCodeRecord。嵌套字段见共享类型。