surveys
POST /v1/surveys/{survey_id}/responses
Record one person's answers to one survey.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу org.read; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка узима org_id као поље у JSON телу.
Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
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[]> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
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.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
survey_id (path) | string | Да | — |
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
org_id | string | Не | — |
distinct_id | string | Не | 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 | Не | — |
answers | SurveyAnswer[] | Да | — |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
recorded | boolean | Да | — |
duplicate | boolean | Да | 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 failed… |
id | string | Не | — |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422