Skip to main content
  • For: anyone writing a recipe for these docs
  • You get: a template to copy, and the rules every recipe follows
  • Time: read it once, about five minutes
  • Scopes: none
A recipe is one complete job for one person, done with a tool they already have. A volunteer should finish it without writing code of their own, and without reading any other page first.

The template

Copy this into apps/developers/recipes/<name>.mdx, then add the page to docs.json under its role, and to Recipes by tool.

The header

Every recipe opens with the same four lines, so a volunteer can tell in five seconds whether it is for them:
  • For: a role, never “developers”. Leaders, treasurers, group admins and trustees, or districts.
  • You get: the finished thing, not the steps. “A Budgets tab”, not “a script that reads budgets”.
  • Time: honest, for someone doing it for the first time.
  • Scopes: every scope the recipe needs, so the admin creating the key gets it right first time.

Style

  • Plain UK English. Short sentences. One idea in each. “Choose”, not “click”; “sign in”, not “log in”.
  • Sentence-case headings. “Switch to your group”, not “Switch To Your Group”.
  • Numbered steps for anything done in order. Use <Steps> when each step needs a sentence of its own.
  • Name what is on screen in bold, exactly as the app or the tool spells it: Settings → Integrations → API keys.
  • Say why when a step is not obvious, in one sentence after it.
  • No jargon a volunteer would not use. Explain a term the first time, or leave it out.

Rules every recipe keeps

  1. It works as written with the sandbox key. Every request uses api-demo.scoutworks.app and the public sandbox key, so a reader can paste it and see real-looking results. Our tests run every request a page spells out, and fail if one stops working.
  2. It never shows a real key. The only key on any page is the sandbox key. Tell readers where to keep their own: Script Properties, a credential store, an environment variable.
  3. It reads every page of a list. Follow nextCursor to the end, and wait retryAfter seconds on a 429. Copy readAll() and fetchScoutworks() from an existing recipe rather than writing new ones.
  4. It treats money as text. The API sends "12.50", never a number, so pennies are never lost. Convert only to show it.
  5. It keeps names out of formulas. Anything written into a spreadsheet passes through safe(), so a name that starts with = stays text.
  6. It warns about personal data. If the result holds names, contact details or who owes money, say who it is safe to share with.
  7. It names the scopes it needs, including the .people or .contacts scope a column needs, and what happens without it.

Recipes that change data

A recipe that writes, such as Bank statement into the books, also:
  • says at the top that the read-only sandbox key cannot run it, so the reader needs their own key with the write scope;
  • has a step that tries it on one made-up item, checks the result in Scoutworks, and deletes or undoes it before the real run;
  • sends an Idempotency-Key with every POST, made from the thing being added, so a retry never adds it twice;
  • sends the If-Match or updatedAt it read with every change, and tells the reader what a 412 stale_write means (Writing data has the rules);
  • waits between writes, to stay under 30 changes a minute;
  • writes back what it did, such as the new id, so a second run skips what is already done.

Suggest a recipe

If your group does something with the API that others could copy, tell us. We’ll write it up in this shape and credit you if you’d like.