Skip to main content
  • For: anyone who writes a little JavaScript
  • You get: a Node.js script that saves the waiting list to a CSV file
  • Time: about five minutes
  • Scopes: waiting-list:read
This script reads the waiting list and saves it to waiting-list.csv. It needs Node.js 18 or later, which has fetch built in. There is nothing to install.
waiting-list.mjs
Run it:

Look up one member

To read one member, ask for them by id. It returns the same fields as the list. A member of another group, or an id that does not exist, answers 404 not_found. This uses get() from the script above, so paste it below that script, or into a file with a copy of BASE, API_KEY and get().
lookup-member.mjs
Your key needs the members:read scope for this part.

Write data

The sandbox key is read only. A write needs your own key, with a write scope, on api.scoutworks.app. Try each write on a test record first, then check it in Scoutworks and undo it there. See Try a write safely. This script adds a draft event, then moves it an hour later only if nobody has changed it since. A draft is safe to try: families hear of an event only when a leader publishes it in Scoutworks, and you can delete it there. The key needs events:read and events:write.
add-draft-event.mjs

Switch to your group

Change api-demo.scoutworks.app to api.scoutworks.app, and set your key in the environment instead of the code. read -s asks for the key without showing it, so it stays out of your shell history:
Your key needs the waiting-list:read scope.

TypeScript

The OpenAPI file describes every response. Generate types from it with openapi-typescript:
Then type a response like this:

Notes

  • Only in a server or a script. Do not call the API from a web page that other people open. The key would be in the page, and anyone could read it.
  • Fields that may be missing. A field that the key’s scopes do not allow is left out. Use w.parent?.email, not w.parent.email, for the .contacts fields.
  • Other lists. Change /waiting-list and the filters. The API reference lists every endpoint and field.