Export an entire event
AI Assist
Start an export job to download all participants for an event as an Excel workbook. For a specific set of leads, use the selected participants example.
Queue a workbook
Section titled “Queue a workbook”Find the event ID and set it as EVENT_ID. Set SNAPADDY_API_KEY to a personal API token with dashboard access to that event and a role that can export all selected reports. An empty participantIds array with no filter selects all non-deleted participants in the event. The API checks access across that selection.
See the API reference for the full request schema.
jq -n --arg event "$EVENT_ID" '{questionnaireId:$event, participantIds:[], downloadType:"EXCEL"}' | curl --fail-with-body 'https://backend.snapaddy.com/job-management/jobs/vr-download' \ -H "x-api-key: $SNAPADDY_API_KEY" -H 'Content-Type: application/json' --data-binary @-const response = await fetch("https://backend.snapaddy.com/job-management/jobs/vr-download", { method: "POST", headers: { "x-api-key": process.env.SNAPADDY_API_KEY!, "Content-Type": "application/json" }, body: JSON.stringify({ questionnaireId: process.env.EVENT_ID!, participantIds: [], downloadType: "EXCEL" }),});if (!response.ok) throw new Error(`Export request failed (${response.status})`);console.log((await response.json()).id);import json, osfrom urllib.request import Request, urlopen
body = {"questionnaireId": os.environ["EVENT_ID"], "participantIds": [], "downloadType": "EXCEL"}request = Request("https://backend.snapaddy.com/job-management/jobs/vr-download", data=json.dumps(body).encode(), method="POST", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"})with urlopen(request, timeout=20) as response: print(json.load(response)["id"])A successful request returns 201. Save its id as JOB_ID. If the selection is empty, the API returns 400 with NO_PARTICIPANTS_FOUND. Each successful submission queues a separate export.
Wait for completion
Section titled “Wait for completion”Use Poll a job to read GET /job-management/jobs/{id}. Wait between requests and stop when the state reaches completed, failed, or canceled. If the job failed, inspect failedReason. Only a completed export has a downloadable result.
Download the workbook
Section titled “Download the workbook”The result endpoint returns JSON containing a signed url. Use your API key for that first request. The signed URL supplies its own authorization for the second request.
url=$(curl --fail --silent --show-error \ "https://backend.snapaddy.com/job-management/jobs/vr-download/$JOB_ID/result" \ -H "x-api-key: $SNAPADDY_API_KEY" | jq -er '.url') && curl --fail --output event.xlsx "$url"import { writeFile } from "node:fs/promises";
const result = await fetch(`https://backend.snapaddy.com/job-management/jobs/vr-download/${process.env.JOB_ID}/result`, { headers: { "x-api-key": process.env.SNAPADDY_API_KEY! },});if (!result.ok) throw new Error(`Result lookup failed (${result.status})`);const { url } = await result.json();const file = await fetch(url);if (!file.ok) throw new Error(`Download failed (${file.status})`);await writeFile("event.xlsx", new Uint8Array(await file.arrayBuffer()));import json, os, shutilfrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/job-management/jobs/vr-download/{os.environ['JOB_ID']}/result"request = Request(url, headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]})with urlopen(request, timeout=20) as response: download_url = json.load(response)["url"]with urlopen(download_url, timeout=60) as response, open("event.xlsx", "wb") as file: shutil.copyfileobj(response, file)A result lookup can return 404 for an unknown or unfinished job. Results expire 30 days after completion, when lookup returns 410. To generate other file formats, see the export API reference.