# Google Classroom on boxd

> Google Classroom is a free web service developed by Google for schools that aims to simplify creating, distributing, and grading assignments.

- Page: https://boxd.sh/integrations/google-classroom/
- CLI: `run google-classroom` (62 commands, 10 marked common)
- SDK: `import { googleClassroom } from "@boxd/run"`; every parameter and response type is at `@boxd/run/google-classroom`
- Triggers: none
- Connect: `run auth google-classroom` (Sign in with Google Classroom), or https://app.boxd.sh/integrations/detail/google_classroom
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth google-classroom      # once: prints a link to connect your account
run google-classroom           # list its commands
run google-classroom courses-list --help
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, googleClassroom } from "@boxd/run";

every("1 hour", async () => {
  const result = await googleClassroom.coursesList({});
  console.log(result);
});
```

Run it with `run google-classroom.run.ts`. Google Classroom has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run google-classroom <command> --help` lists the optional ones. "common" marks what `run google-classroom` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `course-work-create` | `googleClassroom.courseWorkCreate()` | `--courseId` `--title` `--workType` | 12 | Create a CourseWork item in a course |
| `course-work-delete` | `googleClassroom.courseWorkDelete()` | `--courseId` `--id` | 0 | Delete a specific CourseWork |
| `course-work-get` ·common | `googleClassroom.courseWorkGet()` | `--courseId` `--id` | 0 | Get details of a specific coursework |
| `course-work-list` ·common | `googleClassroom.courseWorkList()` | `--courseId` | 5 | List coursework in a course |
| `course-work-materials-create` | `googleClassroom.courseWorkMaterialsCreate()` | `--courseId` | 9 | Create course work material |
| `course-work-materials-get` ·common | `googleClassroom.courseWorkMaterialsGet()` | `--courseId` `--id` | 0 | Get a coursework material |
| `course-work-materials-list` ·common | `googleClassroom.courseWorkMaterialsList()` | `--courseId` | 3 | List course work materials in a course |
| `course-work-student-submissions-list` | `googleClassroom.courseWorkStudentSubmissionsList()` | `--courseId` `--courseWorkId` | 5 | List student submissions for a specific coursework |
| `course-work-student-submissions-reclaim` | `googleClassroom.courseWorkStudentSubmissionsReclaim()` | `--courseId` `--courseWorkId` `--id` | 0 | Reclaim a student submission for editing |
| `courses-aliases-create` | `googleClassroom.coursesAliasesCreate()` | `--alias` `--courseId` | 0 | Create an alias for a course |
| `courses-aliases-delete` | `googleClassroom.coursesAliasesDelete()` | `--alias` `--courseId` | 0 | Delete an alias of a course |
| `courses-aliases-list` | `googleClassroom.coursesAliasesList()` | `--courseId` | 2 | List aliases for a course |
| `courses-announcements-create` | `googleClassroom.coursesAnnouncementsCreate()` | `--courseId` | 6 | Create an announcement in a course |
| `courses-announcements-delete` | `googleClassroom.coursesAnnouncementsDelete()` | `--courseId` `--id` | 0 | Delete an announcement |
| `courses-announcements-get` | `googleClassroom.coursesAnnouncementsGet()` | `--courseId` `--id` | 0 | Get an announcement |
| `courses-announcements-get-add-on-context` | `googleClassroom.coursesAnnouncementsGetAddOnContext()` | `--courseId` `--itemId` | 3 | Get metadata for Classroom add-ons in the context of a specific announcement post |
| `courses-announcements-list` | `googleClassroom.coursesAnnouncementsList()` | `--courseId` | 3 | List announcements in a course |
| `courses-announcements-modify-assignees` | `googleClassroom.coursesAnnouncementsModifyAssignees()` | `--assigneeMode` `--courseId` `--id` | 1 | Modify assignee mode and options of an announcement |
| `courses-announcements-patch` | `googleClassroom.coursesAnnouncementsPatch()` | `--courseId` `--id` `--updateMask` | 6 | Update fields of an announcement |
| `courses-announces-add-on-attachs-delete` | `googleClassroom.coursesAnnouncesAddOnAttachsDelete()` | `--attachmentId` `--courseId` `--itemId` | 1 | Delete an add-on attachment from a course announcement |
| `courses-announces-add-on-attachs-get` | `googleClassroom.coursesAnnouncesAddOnAttachsGet()` | `--attachmentId` `--courseId` `--itemId` | 1 | Get an add-on attachment from an announcement |
| `courses-announces-add-on-attachs-list` | `googleClassroom.coursesAnnouncesAddOnAttachsList()` | `--courseId` `--itemId` | 2 | List all add-on attachments created under an announcement |
| `courses-course-work-add-on-attachs-delete` | `googleClassroom.coursesCourseWorkAddOnAttachsDelete()` | `--attachmentId` `--courseId` `--itemId` | 1 | Delete an add-on attachment from course work |
| `courses-course-work-get-add-on-context` | `googleClassroom.coursesCourseWorkGetAddOnContext()` | `--courseId` `--itemId` | 2 | Get metadata for Classroom add-ons in the context of a specific course work |
| `courses-course-work-materials-add-attachs` | `googleClassroom.coursesCourseWorkMaterialsAddAttachs()` | `--courseId` `--itemId` | 0 | List all add-on attachments under a course work material post |
| `courses-course-work-materials-delete` | `googleClassroom.coursesCourseWorkMaterialsDelete()` | `--courseId` `--id` | 0 | Delete a course work material |
| `courses-course-work-modify-assignees` | `googleClassroom.coursesCourseWorkModifyAssignees()` | `--assigneeMode` `--courseId` `--id` | 1 | Modify assignee mode and options of coursework |
| `courses-course-work-patch` ·common | `googleClassroom.coursesCourseWorkPatch()` | `--courseId` `--id` `--updateMask` | 13 | Update one or more fields of a course work |
| `courses-coursework-rubrics-list` | `googleClassroom.coursesCourseworkRubricsList()` | `--courseId` `--courseWorkId` | 3 | List rubrics for a specific coursework |
| `courses-create` | `googleClassroom.coursesCreate()` | `--name` `--ownerId` | 5 | Create a new course |
| `courses-delete` | `googleClassroom.coursesDelete()` | `--id` | 0 | Delete a course |
| `courses-get` | `googleClassroom.coursesGet()` | `--id` | 0 | Get details for a specific course |
| `courses-get-grading-period-settings` | `googleClassroom.coursesGetGradingPeriodSettings()` | `--courseId` | 0 | Retrieve grading period settings for a course |
| `courses-list` ·common | `googleClassroom.coursesList()` | — | 5 | List all courses accessible to the authenticated user |
| `courses-patch` | `googleClassroom.coursesPatch()` | `--id` `--updateMask` | 7 | Update one or more fields of a Classroom course |
| `courses-posts-add-on-attachments-list` | `googleClassroom.coursesPostsAddOnAttachmentsList()` | `--courseId` `--postId` | 3 | List all add-on attachments created under a post |
| `courses-posts-get-add-on-context` | `googleClassroom.coursesPostsGetAddOnContext()` | `--courseId` `--itemId` `--postId` | 2 | Get metadata for Classroom add-ons in the context of a specific post |
| `courses-students-create` ·common | `googleClassroom.coursesStudentsCreate()` | `--courseId` `--userId` | 1 | Add a student to a course |
| `courses-students-delete` | `googleClassroom.coursesStudentsDelete()` | `--courseId` `--userId` | 0 | Delete a student from a course |
| `courses-students-get` ·common | `googleClassroom.coursesStudentsGet()` | `--courseId` `--userId` | 0 | Retrieve a specific student of a course |
| `courses-students-guardians-list` | `googleClassroom.coursesStudentsGuardiansList()` | `--courseId` `--studentId` | 2 | List guardians of a student in a course |
| `courses-students-list` | `googleClassroom.coursesStudentsList()` | `--courseId` | 2 | List students in a course |
| `courses-teachers-delete` | `googleClassroom.coursesTeachersDelete()` | `--courseId` `--userId` | 0 | Delete a teacher from a course |
| `courses-teachers-get` | `googleClassroom.coursesTeachersGet()` | `--courseId` `--userId` | 2 | Get teacher enrollment |
| `courses-teachers-list` | `googleClassroom.coursesTeachersList()` | `--courseId` | 2 | List teachers in a course |
| `courses-topics-create` | `googleClassroom.coursesTopicsCreate()` | `--courseId` `--name` | 0 | Create a course topic |
| `courses-topics-delete` | `googleClassroom.coursesTopicsDelete()` | `--courseId` `--id` | 0 | Delete a course topic |
| `courses-topics-get` | `googleClassroom.coursesTopicsGet()` | `--courseId` `--id` | 0 | Get a course topic |
| `courses-topics-list` | `googleClassroom.coursesTopicsList()` | `--courseId` | 2 | List topics in a course |
| `courses-topics-patch` | `googleClassroom.coursesTopicsPatch()` | `--courseId` `--id` | 2 | Update fields of a course topic |
| `courses-update` ·common | `googleClassroom.coursesUpdate()` | `--id` `--name` `--ownerId` | 5 | Update a course |
| `courses-work-materials-patch` | `googleClassroom.coursesWorkMaterialsPatch()` | `--courseId` `--id` `--updateMask` | 5 | Update fields of a course work material |
| `get-coursework-addon-attachment` | `googleClassroom.getCourseworkAddonAttachment()` | `--attachmentId` `--courseId` `--postId` | 0 | Get an add-on attachment from course work |
| `get-coursework-material-addon-context` | `googleClassroom.getCourseworkMaterialAddonContext()` | `--courseId` `--itemId` | 2 | Get metadata for Classroom add-ons in the context of a specific course work material |
| `invitations-create` | `googleClassroom.invitationsCreate()` | `--courseId` `--role` `--userId` | 0 | Create an invitation for a user to a course |
| `invitations-delete` | `googleClassroom.invitationsDelete()` | `--id` | 0 | Delete an invitation |
| `invitations-get` | `googleClassroom.invitationsGet()` | `--id` | 0 | Retrieve an invitation by its identifier |
| `invitations-list` | `googleClassroom.invitationsList()` | — | 4 | List invitations that the requesting user is permitted to view |
| `list-courses-student-groups` | `googleClassroom.listCoursesStudentGroups()` | `--courseId` | 2 | List student groups in a course |
| `list-coursework-addon-attachments` | `googleClassroom.listCourseworkAddonAttachments()` | `--courseId` `--postId` | 0 | List all add-on attachments created by an add-on under a course work |
| `registrations-create` | `googleClassroom.registrationsCreate()` | `--cloudPubsubTopic` `--feed` | 0 | Create a registration for push notifications from Google Classroom |
| `user-profiles-get` ·common | `googleClassroom.userProfilesGet()` | `--userId` | 0 | Retrieve a user profile by user ID |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
