Skip to content
MockFlow DevelopersGet an API key

Teachers connect MockFlow, and each assignment becomes a board shared with the class.

Updated 14 Oct 20262 min read

A learning platform wants project assignments to happen on a visual board instead of a document upload. With this plugin, each teacher connects their own MockFlow account once. Creating an assignment then makes a board in the teacher's class space, with the brief, the rubric as a checklist and an area for the students' work, and shares the space with the class roster.

Download the code (Node.js 18 or later, no packages)

What it creates

  • A space for the class in the teacher's account, found by name or made the first time.

  • Every student on the roster added to the space as an editor, with an invitation email the first time.

  • An assignment board with the brief as markdown, the rubric as a checklist, and a "Your work" section.

How it works

  1. The teacher connects through the OAuth flow with the scopes user:read boards:write members:write.

  2. List the teacher's spaces to find the class space, or create it.

  3. Share the space with each student. Adding someone who is already a member keeps them there with the role you send.

  4. Create the board in the space and draw the brief, rubric and work area in one batch.

Run the example

Register an app in the OAuth apps tab of the developer console with the redirect URI http://localhost:3000/oauth/callback and the scopes user:read, boards:write and members:write. Put test emails in class.json, then:

cp .env.example .env        # paste the client ID and secret into .env
node server.js              # open http://localhost:3000

The key code

let space = null;
for await (const sp of mf.paginate('/spaces')) if (sp.name === cls.className) space = sp;
if (!space) space = await mf.post('/spaces', { name: cls.className });

for (const email of cls.students) {
  await mf.post(`/spaces/${space.id}/members`, { email, role: 'editor' });
}

const board = await mf.post('/boards', { title: f.title, spaceId: space.id });

Plan limits for teachers

The space, the board and the sharing happen in the teacher's account, under the teacher's plan. Adding students as editors needs Plus or Max. On Basic, a space can be shared as reviewer only, with up to five people, and there is one space; the example shows the API's message and an upgrade link when it answers 402.

What you need

An OAuth app with the scopes user:read, boards:write and members:write.

Was this page helpful?

Sign in to MockFlow

The same account you use in the app and on the API.

Forgot your password?
or
Continue with GoogleContinue with MicrosoftContinue with Apple