Create a VisitReport report
AI Assist
Create a visit report for an event with the participant’s contact details. You can save questionnaire answers while the report is in progress and complete it when it’s ready.
An event supplies the questionnaire everyone uses. A report holds one interaction’s participants and answers. The first participant is the parent participant. Its ID identifies the report throughout this guide.
Create the report
Section titled “Create the report”Set EVENT_ID to the ID from Find events and SNAPADDY_API_KEY to a personal API token. The token holder needs app access to create and upload reports.
Save this fictional contact as participant.json. The create endpoint spells the name fields firstname and lastname. The contact uses empty strings for unused text fields, -1 for unknown gender, and empty objects for customFields and meta.
See the API reference for the full request schema.
{ "firstname": "Alex", "lastname": "Morgan", "organization": "Northstar Systems", "email": "alex@example.com", "quickScan": false, "customFields": {}, "meta": {}, "city": "", "contactSource": null, "country": "", "fax": "", "gender": -1, "linkedIn": "", "mobile": "", "note": "", "phone": "", "poBox": "", "position": "", "state": "", "street": "", "street2": "", "title": "", "vat": "", "website": "", "zip": ""}Send the contact once. A successful request creates an unfinished report and returns 201. Save the returned participantId as REPORT_ID before submitting answers. Repeating this POST creates another report.
curl --fail-with-body --silent --show-error -X POST \ "https://backend.snapaddy.com/questionnaire/v1/$EVENT_ID/report/create" \ -H "x-api-key: $SNAPADDY_API_KEY" -H "Content-Type: application/json" --data-binary @participant.json | jq '.participantId'import { readFile } from "node:fs/promises";
const response = await fetch(`https://backend.snapaddy.com/questionnaire/v1/${encodeURIComponent(process.env.EVENT_ID!)}/report/create`, { method: "POST", headers: { "x-api-key": process.env.SNAPADDY_API_KEY!, "Content-Type": "application/json" }, body: await readFile("participant.json", "utf8"),});if (!response.ok) throw new Error(`Request failed (${response.status}): ${await response.text()}`);const data = await response.json();console.log(data.participantId);import jsonimport osfrom pathlib import Pathfrom urllib.parse import quotefrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/questionnaire/v1/{quote(os.environ['EVENT_ID'], safe='')}/report/create"request = Request(url, method="POST", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"}, data=Path("participant.json").read_bytes())with urlopen(request, timeout=20) as response: data = json.load(response)print(data["participantId"])Your report is now saved in progress. You can stop here or add questionnaire answers.
Find the question and its input
Section titled “Find the question and its input”To prefill an answer, choose a text or multiline text question in the event. Read the event and look under questionGroups[].questions[]. For this example, find the prompt What should we follow up on? under the event’s language in texts. Store the question’s id as QUESTION_ID and its input option’s id as OPTION_ID. Use IDs from this event even when another event displays the same prompt.
curl --fail-with-body --silent --show-error \ "https://backend.snapaddy.com/questionnaire/v1/$EVENT_ID" \ -H "x-api-key: $SNAPADDY_API_KEY" | jq '.questionGroups[] | .questions[] | select(.questionType == "Text" or .questionType == "Textarea") | {id, texts, questionOptions: [.questionOptions[] | {id, questionOptionType}]}'const response = await fetch(`https://backend.snapaddy.com/questionnaire/v1/${encodeURIComponent(process.env.EVENT_ID!)}`, { method: "GET", headers: { "x-api-key": process.env.SNAPADDY_API_KEY! },});if (!response.ok) throw new Error(`Request failed (${response.status}): ${await response.text()}`);const data = await response.json();for (const group of data.questionGroups) { for (const q of group.questions) { if (["Text", "Textarea"].includes(q.questionType)) console.log(q.id, q.texts, q.questionOptions); }}import jsonimport osfrom urllib.parse import quotefrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/questionnaire/v1/{quote(os.environ['EVENT_ID'], safe='')}"request = Request(url, method="GET", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]})with urlopen(request, timeout=20) as response: data = json.load(response)for group in data["questionGroups"]: for q in group["questions"]: if q["questionType"] in ("Text", "Textarea"): print(q["id"], q["texts"], q["questionOptions"])Prefill the answer
Section titled “Prefill the answer”Build the upload for the report you just created. A top-level question uses parentQuestionOptionId: null. Even for a free-text question, put the value in options[].text alongside its questionOptionId.
See the API reference for the full request schema.
jq -n --slurpfile participant participant.json --arg report "$REPORT_ID" \ --arg question "$QUESTION_ID" --arg option "$OPTION_ID" '{ participants: {parent: ($participant[0] + {participantId:$report}), children: []}, answers: [{questionId:$question, parentQuestionOptionId:null, options:[{questionOptionId:$option, text:"Send pricing for the autumn rollout."}]}] }' > upload.jsonimport { readFile, writeFile } from "node:fs/promises";
const participant = JSON.parse(await readFile("participant.json", "utf8"));const upload = { participants: { parent: { ...participant, participantId: process.env.REPORT_ID! }, children: [] }, answers: [{ questionId: process.env.QUESTION_ID!, parentQuestionOptionId: null, options: [{ questionOptionId: process.env.OPTION_ID!, text: "Send pricing for the autumn rollout." }] }],};await writeFile("upload.json", JSON.stringify(upload));import json, osfrom pathlib import Path
parent = json.loads(Path("participant.json").read_text())parent["participantId"] = os.environ["REPORT_ID"]answer = {"questionId": os.environ["QUESTION_ID"], "parentQuestionOptionId": None, "options": [{"questionOptionId": os.environ["OPTION_ID"], "text": "Send pricing for the autumn rollout."}]}Path("upload.json").write_text(json.dumps({"participants": {"parent": parent, "children": []}, "answers": [answer]}))Send the upload to save the answers. A full upload replaces the participant and answer collections. For an existing report, read its current snapshot and include the participants and answers you want to keep. To replace just the answers, use PUT /v1/report/{reportId}/answers with dashboard access. That request preserves the participants.
The report stays In Progress after upload. Complete it in VisitReport when it’s ready, or hand it over for a colleague to continue.
curl --fail-with-body --silent --show-error -X PUT \ "https://backend.snapaddy.com/questionnaire/v1/report/$REPORT_ID/upload" \ -H "x-api-key: $SNAPADDY_API_KEY" -H "Content-Type: application/json" --data-binary @upload.jsonimport { readFile } from "node:fs/promises";
const response = await fetch(`https://backend.snapaddy.com/questionnaire/v1/report/${encodeURIComponent(process.env.REPORT_ID!)}/upload`, { method: "PUT", headers: { "x-api-key": process.env.SNAPADDY_API_KEY!, "Content-Type": "application/json" }, body: await readFile("upload.json", "utf8"),});if (!response.ok) throw new Error(`Request failed (${response.status}): ${await response.text()}`);console.log(response.status);import osfrom pathlib import Pathfrom urllib.parse import quotefrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/questionnaire/v1/report/{quote(os.environ['REPORT_ID'], safe='')}/upload"request = Request(url, method="PUT", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"], "Content-Type": "application/json"}, data=Path("upload.json").read_bytes())with urlopen(request, timeout=20) as response: print(response.status)Hand the unfinished report to a colleague
Section titled “Hand the unfinished report to a colleague”For example, a visitor asks for pricing before a trade show. Your integration can prefill that request and hand the unfinished report to the salesperson who will meet them.
Enable report handover in the event settings.
- When creating a custom event, choose Events → Create event → Custom event → Additional features → Team coordination.
- Open Team coordination → Settings and check Enable handing over reports in the app. The API exposes this setting as
handoverEnabled. - Publish the event and give the receiving colleague app access.
Keep the report unfinished when someone else will continue it. List recipients and choose the colleague by their username or fullName. Set RECIPIENT_ID to that person’s userId. The service checks the recipient’s organization membership and event access again when you submit the handover.
See the API reference for the full request schema.
curl --fail-with-body --silent --show-error \ "https://backend.snapaddy.com/questionnaire/v1/report/$REPORT_ID/handover/recipients" \ -H "x-api-key: $SNAPADDY_API_KEY" | jq '.recipients[] | {fullName, username, userId}'const response = await fetch(`https://backend.snapaddy.com/questionnaire/v1/report/${encodeURIComponent(process.env.REPORT_ID!)}/handover/recipients`, { method: "GET", headers: { "x-api-key": process.env.SNAPADDY_API_KEY! },});if (!response.ok) throw new Error(`Request failed (${response.status}): ${await response.text()}`);const data = await response.json();console.log(data.recipients);import jsonimport osfrom urllib.parse import quotefrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/questionnaire/v1/report/{quote(os.environ['REPORT_ID'], safe='')}/handover/recipients"request = Request(url, method="GET", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]})with urlopen(request, timeout=20) as response: data = json.load(response)print(data["recipients"])Hand over the report using the sender’s token. A successful request returns 204 with an empty body. VisitReport can notify the recipient on a registered device.
curl --fail-with-body --silent --show-error -X POST \ "https://backend.snapaddy.com/questionnaire/v1/report/$REPORT_ID/handover/recipient/$RECIPIENT_ID" \ -H "x-api-key: $SNAPADDY_API_KEY" --write-out '%{http_code}\n'const response = await fetch(`https://backend.snapaddy.com/questionnaire/v1/report/${encodeURIComponent(process.env.REPORT_ID!)}/handover/recipient/${encodeURIComponent(process.env.RECIPIENT_ID!)}`, { method: "POST", headers: { "x-api-key": process.env.SNAPADDY_API_KEY! },});if (!response.ok) throw new Error(`Request failed (${response.status}): ${await response.text()}`);console.log(response.status);import osfrom urllib.parse import quotefrom urllib.request import Request, urlopen
url = f"https://backend.snapaddy.com/questionnaire/v1/report/{quote(os.environ['REPORT_ID'], safe='')}/handover/recipient/{quote(os.environ['RECIPIENT_ID'], safe='')}"request = Request(url, method="POST", headers={"x-api-key": os.environ["SNAPADDY_API_KEY"]})with urlopen(request, timeout=20) as response: print(response.status)Open the report in VisitReport
Section titled “Open the report in VisitReport”In the event, open Reports → Received reports → Alex Morgan. The Participants screen shows Alex at Northstar Systems. Tap Start questionnaire and open Discovery to see the prefilled answer. The recipient can edit the answer and continue the conversation before completing the report.
Handover requires an unfinished report, its parent participant ID, and a recipient other than the sender. A disabled event handover, a completed report, or an attempt to hand a report to yourself returns 409. If a listed colleague gets rejected with 403, check their event app access and the event’s availability.
Complete the report in VisitReport
Section titled “Complete the report in VisitReport”- App. Open the event and find the report under Reports → In Progress. Choose Complete once all required fields are filled. Completing reports in the app
- Dashboard. For a live event, open Reports → In Progress, hover over the report, and choose Complete Report. Confirm with Complete. Completing reports in the dashboard
A completed report is no longer eligible for handover.
Questionnaire structure reference · Report and handover reference