surveys
POST /v1/surveys/{survey_id}/responses
Record one person's answers to one survey.
Tabbatar da Asali
Aika maɓallin API azaman alamar ɗauka (bearer token). Dole ne maɓallin ya kasance yana da izinin org.read; idan babu shi, za a ƙi amfani da maɓallin tare da lambar 403, ba 404 ba.
Inda ID ɗin kungiyar ku ke zuwa
Wannan ma'ajiyar tana karɓar org_id a matsayin fili a cikin jikin JSON.
Ana samun lambar kungiyar ku a kan shafin maɓallan API a cikin madanninku, kusa da maɓallin kansa. Shi ne lambar da ta dace a kowane kiran da kuka yi.
Gwada
May gurbin komai da ke cikin kusurwa da ƙimar ka, kuma may gurbin maballi da maballi daga allon sarrafa ka.
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[]> }'An shiga? Na'urar sarrafa API da ke cikin sashin kulawarka tana cika ainihin lambar ƙungiyarka da maɓallinka naka, sannan tana gudanar da buƙatar a kan ainihin API don haka zaka iya ganin amsar gaske. Buɗe wannan tashar a cikin na'urar kula da API
Bayani
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`.
Sigogi
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
survey_id (path) | string | Eh | — |
Jikin buƙata
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
org_id | string | A'a | — |
distinct_id | string | A'a | 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 | A'a | — |
answers | SurveyAnswer[] | Eh | — |
Martani
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
recorded | boolean | Eh | — |
duplicate | boolean | Eh | 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 | A'a | — |
Kuskuren da wannan matsaya za ta iya maido wa
401 · 403 · 404 · 422