surveys
POST /v1/surveys/{survey_id}/responses
Record one person's answers to one survey.
Xaqiijinta aqoonsiga
U dir furaha API ah calaamad dusha ah (bearer token). Furaha waa inuu wataa ruqadda org.read; furaha aan wadan waxaa loo diidayaa 403, ee ma aha 404.
Meesha aqoonsiga ururkaagu galayo
Boggan waxaa uu qaataa org_id oo ah goob ku jirta JSON body.
Aqoonsiga ururkaagu wuxuu ku yaallaa shaashada furayaasha API ee dashboard-kaaga, oo ku xiga furaha laftiisa. Waa isku aqoonsi wicitaan kasta oo aad sameyso.
Isku day
Ku beddel wax kasta oo ku dhex jira qeebaha xaglaha ah qiimayaashaada, sidoo kalena haystaaha furaha ku beddel fure ka dhex muuqda dashboordigaaga.
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[]> }'Ma sign-garaysay? Qalabka API ee ku jira dashboard-kaagu wuxuu buuxiyaa aqoonsigaaga ururka ee dhabta ah iyo furahaaga gaarka ah, wuxuuna ku shaqeysiiyaa codsiga API-ga nool si aad u aragto jawaabta dhabta ah. Kani ka fur barta kontoroolka ee API
Faahfaahin
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`.
Cabiraha
| Magaca | Nooc | Loo baahan yahay | Maxay tahay |
|---|---|---|---|
survey_id (path) | string | Haa | — |
Codsiga jidhkiisa
| Magaca | Nooc | Loo baahan yahay | Maxay tahay |
|---|---|---|---|
org_id | string | Maya | — |
distinct_id | string | Maya | 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 | Maya | — |
answers | SurveyAnswer[] | Haa | — |
Jawaab
| Magaca | Nooc | Loo baahan yahay | Maxay tahay |
|---|---|---|---|
recorded | boolean | Haa | — |
duplicate | boolean | Haa | 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 | Maya | — |
Cilladaha ay bartaani soo celin karto
401 · 403 · 404 · 422