surveys

POST /v1/surveys/{survey_id}/responses

Record one person's answers to one survey.

כל נקודות הקצה מסוג surveys

אימות

שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה 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 הפיזי כך שתוכל לראות את התגובה בפועל. פתח נקודת קצה זו במסוף ה-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לא

שגיאות שנקודה קצה זו עשויה להחזיר

401 · 403 · 404 · 422