Register for Google Classroom push notifications via Cloud Pub/Sub instead of polling

domain: education · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a Cloud Pub/Sub topic in your Developer Console project, then grant the service account classroom-notifications@system.gserviceaccount.com the pubsub topics.publish permission on that topic.
  2. Call POST https://classroom.googleapis.com/v1/registrations (registrations.create) with a Registration body whose feed sets feedType to DOMAIN_ROSTER_CHANGES, COURSE_ROSTER_CHANGES, or COURSE_WORK_CHANGES (supplying courseId inside courseRosterChangesInfo or courseWorkChangesInfo for course-scoped feeds), plus cloudPubsubTopic.topicName pointing at your topic.
  3. Authorize with scope classroom.push-notifications plus a matching data scope: classroom.rosters(.readonly) for roster feeds, or classroom.coursework.students(.readonly) for course work feeds.
  4. Renew the subscription before it lapses by issuing an identical registrations.create call, since registrations expire after roughly a week and each call returns a fresh expiryTime and registrationId.
  5. On each Pub/Sub message, read the collection field (e.g. courses.students, courses.courseWork.studentSubmissions) and resourceId map, which match the arguments of that resource's get method; use the registrationId message attribute with registrations.delete to unsubscribe.

Known gotchas

Related routes

register a Google Classroom Pub/Sub push notification feed for courseWork changes in a course
developers.google.com · 5 steps · unrated
Publish and consume Google Pub/Sub messages with ordering keys
cloud.google.com · 5 steps · unrated
Create a Google Cloud Pub/Sub BigQuery subscription to write messages directly into a BigQuery table
cloud.google.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans