surveys
POST /v1/surveys/{survey_id}/responses
Record one person's answers to one survey.
Autentifikimi
Drgoni një çelës API si një token mbajtës. Çelësi duhet të ketë lejen org.read; një çelës pa të refuzohet me 403, jo 404.
Ku shkon id i organizatës suaj
Ky endpoint pranon org_id si fushë në trupin JSON.
ID-ja e organizatës suaj ndodhet në ekranin e çelësave API në panelin tuaj të kontrollit, pranë vetë çelësit. Është i njëjti ID në çdo thirrje që bëni.
Provoje
Zëvendësoni çdo gjë brenda kllapave këndore me vlerat tuaja dhe vendbanuesin e çelësit me një çelës nga paneli juaj.
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[]> }'Jeni kyçur? Konsola e API-së në panelin tuaj plotëson ID-në tuaj reale të organizatës dhe çelësin tuaj, dhe ekzekuton kërkesën kundrejt API-së live, kështu që ju mund të shihni përgjigjen aktuale. Hapni këtë pikë fundore në konsolën e API-së
Detajet
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`.
Parametrat
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
survey_id (path) | string | Po | — |
Trupi i kërkesës
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
org_id | string | Jo | — |
distinct_id | string | Jo | The 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. |
path | string | Jo | — |
answers | SurveyAnswer[] | Po | — |
Përgjigja
| Emri | Lloji | Kërkohet | Çfarë është kjo |
|---|---|---|---|
recorded | boolean | Po | — |
duplicate | boolean | Po | True 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… |
id | string | Jo | — |
Gabimet që ky pikëndalim mund të kthejë
401 · 403 · 404 · 422