surveys

POST /v1/surveys/{survey_id}/responses

Record one person's answers to one survey.

Alle surveys Endpunkte

Authentifizierung

Senden Sie einen API-Schlüssel als Bearer-Token. Der Schlüssel muss über die Berechtigung org.read verfügen; ein Schlüssel ohne diese wird mit 403 statt 404 abgelehnt.

Hier kommt Ihre Organisations-ID hin

Dieser Endpunkt akzeptiert org_id als Feld im JSON-Body.

Die ID Ihrer Organisation finden Sie im Dashboard auf dem Bildschirm für API-Schlüssel direkt neben dem Schlüssel selbst. Sie ist bei jedem Ihrer Aufrufe dieselbe.

Ausprobieren

Ersetzen Sie alles in spitzen Klammern durch Ihre eigenen Werte und den Platzhalter für den Schlüssel durch einen Schlüssel aus Ihrem Dashboard.

curl -X POST https://api.zinndigital.com/v1/surveys/{survey_id}/responses \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "answers": <SurveyAnswer[]> }'

Angemeldet? Die API-Konsole in Ihrem Dashboard trägt automatisch Ihre echte Organisations-ID sowie Ihren eigenen Schlüssel ein und führt die Anfrage gegen die Live-API aus, sodass Sie die tatsächliche Antwort sehen können. Öffnen Sie diesen Endpunkt in der API-Konsole

Details

Stored in our own organisation-scoped table FIRST and unconditionally, then mirrored to the behavioural backend so the analytics join resolves. The two copies have opposite error policies deliberately: losing the customer's answer is unacceptable, losing the vendor's copy of an answer we already hold costs a join. ⛔ The survey is re-fetched and re-checked against the store — a client sends an id, and a client is a thing a person can edit. Answering an archived or stopped survey is refused. A SECOND answer from the same person returns `200` with `duplicate: true` rather than a conflict: the unique constraint exists to stop a doubled count, and the commonest way it fires is a retry after a dropped connection. Requires `org.read`.

Parameter

NameTypErforderlichWas es ist
survey_id (path)stringJa

Anfragekörper

NameTypErforderlichWas es ist
org_idstringNein
distinct_idstringNeinThe browser's analytics distinct id. ⛔ Without it the mirrored event attaches to a person who does not exist, and the join looks healthy and is empty.
pathstringNein
answersSurveyAnswer[]Ja

Antwort

NameTypErforderlichWas es ist
recordedbooleanJa
duplicatebooleanJaTrue when this person had already answered. ⛔ Reported as a success, not a conflict — the commonest cause is a retry after a dropped connection, and telling the customer it fail…
idstringNein

Fehler, die dieser Endpunkt zurückgeben kann

401 · 403 · 404 · 422