surveys

POST /v1/surveys/{survey_id}/responses

Record one person's answers to one survey.

Dukkan surveys wuraren ƙarshe

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

SunaNau'iAna buƙataAbin da yake
survey_id (path)stringEh

Jikin buƙata

SunaNau'iAna buƙataAbin da yake
org_idstringA'a
distinct_idstringA'aThe 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.
pathstringA'a
answersSurveyAnswer[]Eh

Martani

SunaNau'iAna buƙataAbin da yake
recordedbooleanEh
duplicatebooleanEhTrue 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…
idstringA'a

Kuskuren da wannan matsaya za ta iya maido wa

401 · 403 · 404 · 422