surveys

POST /v1/surveys/{survey_id}/responses

Record one person's answers to one survey.

Toate punctele finale surveys

Autentificare

Trimiteți o cheie API ca token de tip bearer. Cheia trebuie să aibă permisiunea org.read; o cheie care nu o are va fi respinsă cu 403, nu 404.

Unde merge ID-ul organizației tale

Acest punct final preia org_id ca câmp în corpul JSON.

ID-ul organizației tale se află pe ecranul cheilor API din panoul de control, lângă cheia însăși. Este același ID în fiecare apel pe care îl faci.

Încearcă

Înlocuiți tot ce se află între paranteze unghiulare cu propriile valori și substituentul cheie cu o cheie din tabloul de bord.

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[]> }'

Autentificat? Consola API din panoul de control îți completează ID-ul real al organizației și propria cheie și rulează cererea în API-ul live, astfel încât să poți vedea răspunsul efectiv. Deschideți acest punct final în consola API

Detalii

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`.

Parametri

NumeTipObligatoriuCe este
survey_id (path)stringDa

Corp cerere

NumeTipObligatoriuCe este
org_idstringNu
distinct_idstringNuThe 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.
pathstringNu
answersSurveyAnswer[]Da

Răspuns

NumeTipObligatoriuCe este
recordedbooleanDa
duplicatebooleanDaTrue 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…
idstringNu

Erori pe care le poate returna acest punct final

401 · 403 · 404 · 422