Work with reports and participants
AI Assist
A report captures one interaction at a VisitReport event. It can include multiple participants, each with contact details and associated answers. Use the Reports API to export event leads, read answers, or correct a participant’s details.
Use a personal API token in x-api-key. The examples use the base URL https://backend.snapaddy.com/questionnaire.
To process completed reports on export, add a DataAgents workflow to your VisitReport event.
Find reports for an event
Section titled “Find reports for an event”Get the event ID using Find events. Submit it as questionnaireId in the URL. The request body lets you search, filter, sort, and page through reports.
See the API reference for the full search request schema.
curl --fail-with-body \ 'https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001/reports/grid-view' \ -H "x-api-key: $SNAPADDY_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"pagination":{"limit":10,"offset":0}}'const apiKey = process.env.SNAPADDY_API_KEY;if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");
const payload = { pagination: { limit: 10, offset: 0 }};const response = await fetch("https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001/reports/grid-view", { method: "POST", headers: { "x-api-key": apiKey, "Content-Type": "application/json" }, body: JSON.stringify(payload),});if (!response.ok) throw new Error(`Request failed (${response.status})`);console.log(await response.json());import jsonimport osfrom urllib.request import Request, urlopen
payload = { "pagination": { "limit": 10, "offset": 0 }}request = Request( "https://backend.snapaddy.com/questionnaire/v1/ExampleEvent0001/reports/grid-view", method="POST", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"}, data=json.dumps(payload).encode(),)with urlopen(request, timeout=20) as response: print(json.load(response))This search uses POST to accept a JSON body and returns 201. It reads report data. It requires access to the event in the dashboard. Reporters see only their own reports in this view.
reportCountcounts matching reports before pagination.participantCountcounts participants associated with the matching reports.reportscontains participant rows. UseparentIdwhen present and otherwiseidto identify the report. Group rows by that value when you need one record per report.- Advance
offsetby the number of report IDs returned on the page, keeping filters and sort order consistent. Counting participant rows can skip reports.
Read a report and its answers
Section titled “Read a report and its answers”Call GET /v1/report/{reportId} with a report ID from the search. The response includes participants and answers. Participant contact fields appear under participants[].address in this response. Use the participant ID to find a specific person in that array. If you already have a participant ID from the legacy API, the detail endpoint can resolve it to the containing report. Use the returned report ID for later report-level requests.
Get the event’s questionnaire structure to interpret answers[].questionId and answers[].answerOptions[].questionOptionId. The report includes answer and answer-option IDs for matching existing records. For files, use attachment references from the report or files[].publicUrlPath from Download a report snapshot. Follow the returned path for the corresponding environment. The snapshot route returns JSON, while the file path points to the file.
Export participants to a file
Section titled “Export participants to a file”Use an export job when a sales team needs a spreadsheet, vCards, or report documents. Give the job an event ID and the participant IDs from your report search. For a row with a parent, use the row’s own id to select that participant. The token needs dashboard access to the event and a role that can export the selected reports.
To include every participant, export an entire event.
Create the export
Section titled “Create the export”This example exports one participant to an Excel workbook. Replace both IDs with values from your event. The request queues an asynchronous job and returns its ID. Larger exports can take longer, depending on the number of reports and the export format. Wait for the job to complete before requesting the download link.
See the API reference for the full request schema.
JOBS=https://backend.snapaddy.com/job-management/jobs
curl --fail-with-body "$JOBS/vr-download" \ -H "x-api-key: $SNAPADDY_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "questionnaireId": "ExampleEvent0001", "participantIds": ["ExamplePerson001"], "downloadType": "EXCEL" }'const apiKey = process.env.SNAPADDY_API_KEY;if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");
const payload = { questionnaireId: "ExampleEvent0001", participantIds: [ "ExamplePerson001" ], downloadType: "EXCEL"};const response = await fetch("https://backend.snapaddy.com/job-management/jobs/vr-download", { method: "POST", headers: { "x-api-key": apiKey, "Content-Type": "application/json" }, body: JSON.stringify(payload),});if (!response.ok) throw new Error(`Request failed (${response.status})`);console.log(await response.json());import jsonimport osfrom urllib.request import Request, urlopen
payload = { "questionnaireId": "ExampleEvent0001", "participantIds": [ "ExamplePerson001" ], "downloadType": "EXCEL"}request = Request( "https://backend.snapaddy.com/job-management/jobs/vr-download", method="POST", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"}, data=json.dumps(payload).encode(),)with urlopen(request, timeout=20) as response: print(json.load(response))Keep the job’s id from the 201 response. Each participant must belong to the specified event. An empty participantIds array applies the event filters and can select every participant. For other output formats, set downloadType to PDF, V_CARD, ATTACHMENT, or SIGNATURE_PDF. To combine PDF reports into one document, use downloadType: "PDF" and documentStrategy: "merged".
Retrieve the file
Section titled “Retrieve the file”Poll GET /jobs/{id} with the Job Management guide. Once the job reaches completed, set JOB_ID to its ID and fetch the download link. This example uses jq to read the url field.
JOBS=https://backend.snapaddy.com/job-management/jobs
DOWNLOAD_URL=$(curl --fail --silent --show-error "$JOBS/vr-download/$JOB_ID/result" \ -H "x-api-key: $SNAPADDY_API_KEY" | jq -er '.url') && curl --fail --output participants.xlsx "$DOWNLOAD_URL"import { writeFile } from "node:fs/promises";
const apiKey = process.env.SNAPADDY_API_KEY;if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");const jobId = process.env.JOB_ID;if (!jobId) throw new Error("Set JOB_ID");
const response = await fetch(`https://backend.snapaddy.com/job-management/jobs/vr-download/${encodeURIComponent(jobId)}/result`, { headers: { "x-api-key": apiKey },});if (!response.ok) throw new Error(`Request failed (${response.status})`);const { url } = await response.json();const file = await fetch(url);if (!file.ok) throw new Error(`Download failed (${file.status})`);await writeFile("participants.xlsx", new Uint8Array(await file.arrayBuffer()));import jsonimport osfrom pathlib import Pathfrom urllib.parse import quotefrom urllib.request import Request, urlopen
request = Request( f"https://backend.snapaddy.com/job-management/jobs/vr-download/{quote(os.environ['JOB_ID'], safe='')}/result", 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=30) as file: Path("participants.xlsx").write_bytes(file.read())The signed URL authorizes the file download by itself. Send your API key only to the snapAddy endpoint. A result request returns 404 for an unfinished or unknown job and 410 for a result older than 30 days after completion. To remove a finished export earlier, an authorized user can call DELETE /jobs/vr-download/{id} to delete the export job and its stored file.
Correct a participant
Section titled “Correct a participant”Call PATCH /v1/participant/{participantId} with the participant’s ID. Send the contact fields you want to update.
See the API reference for the full request schema.
curl --fail-with-body -X PATCH \ 'https://backend.snapaddy.com/questionnaire/v1/participant/ExamplePerson001' \ -H "x-api-key: $SNAPADDY_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"firstName":"Alex","lastName":"Morgan"}'const apiKey = process.env.SNAPADDY_API_KEY;if (!apiKey) throw new Error("Set SNAPADDY_API_KEY");
const payload = { firstName: "Alex", lastName: "Morgan"};const response = await fetch("https://backend.snapaddy.com/questionnaire/v1/participant/ExamplePerson001", { method: "PATCH", headers: { "x-api-key": apiKey, "Content-Type": "application/json" }, body: JSON.stringify(payload),});if (!response.ok) throw new Error(`Request failed (${response.status})`);console.log(await response.json());import jsonimport osfrom urllib.request import Request, urlopen
payload = { "firstName": "Alex", "lastName": "Morgan"}request = Request( "https://backend.snapaddy.com/questionnaire/v1/participant/ExamplePerson001", method="PATCH", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"}, data=json.dumps(payload).encode(),)with urlopen(request, timeout=20) as response: print(json.load(response))Create, save, and complete a report
Section titled “Create, save, and complete a report”For a complete example in cURL, TypeScript and Python, prefill questionnaire answers and hand over or complete the report.
- Send the first participant’s details to
POST /v1/{questionnaireId}/report/create. The create schema usesfirstnameandlastname. Keep the returnedparticipantId, which is the new report’s ID. - For an existing report, fetch a fresh snapshot with
GET /v1/report/{reportId}/download. Use the upload request schema to send the complete participant and answer collections toPUT /v1/report/{reportId}/upload. Omitted participants and answers can be removed. Preserve existing IDs and values that you intend to keep. - Uploading saves the report in In Progress. Complete it in VisitReport when it’s ready, or hand it over for a colleague to continue.
The snapshot operation checks app access and the caller’s access to the report. For a contact field correction, use the participant patch above.