surveys

POST /v1/surveys/{survey_id}/responses

Record one person's answers to one survey.

Всички крайни точки в surveys

Упълномощаване

Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението org.read; ключ без него се отхвърля с 403, а не с 404.

Където отива идентификаторът на вашата организация

Този краен пункт приема 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 конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в 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_idstringНе
distinct_idstringНе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.
pathstringНе
answersSurveyAnswer[]Да

Отговор

ИмеТипЗадължителноКакво представлява
recordedbooleanДа
duplicatebooleanДа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…
idstringНе

Грешки, които този крайpoint може да върне

401 · 403 · 404 · 422