Skip to main content
Version: 26.01

Surveys - Submit Response

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/i/feedback/inputs

Overview​

Records a Survey or NPS event (shown, closed or answered) sent by a client-side widget. The request is checked and then passed on to the regular /i data ingestion, without a checksum.

Authentication​

This is an SDK-facing endpoint. Identify the app with app_key (or app_id) and the user with device_id. No api_key or auth_token is required.

Permissions​

No dashboard permission is checked. The app is identified by app_key or app_id.

Request Parameters​

ParameterTypeRequiredDescription
eventsJSON String (Array)YesJSON-stringified array with exactly one event whose key is [CLY]_nps or [CLY]_survey.
app_keyStringConditionalApplication key. Required if app_id is not provided.
app_idStringConditionalApplication ID. Required if app_key is not provided.
device_idStringYesDevice ID of the user.
app_versionStringNoApplication version, passed on to ingestion.
sdk_nameStringNoSDK name, passed on to ingestion.
sdk_versionStringNoSDK version, passed on to ingestion.
dowNumberNoDay of week, passed on to ingestion.
hourNumberNoHour of day, passed on to ingestion.

Only the parameters listed above are passed on to ingestion; any others are dropped.

events Object Structure​

FieldTypeRequiredDescription
keyStringYes[CLY]_nps or [CLY]_survey.
segmentation.widget_idStringYesID of the widget the event belongs to.
segmentation.ratingNumberConditionalNPS rating of an answer ([CLY]_nps).
segmentation.journeyInstanceIdStringNoJourney instance ID, for surveys shown by a journey.
segmentation.blockIdStringNoJourney block ID, for surveys shown by a journey.

Survey answers are sent as segmentation keys that start with answ.

Examples​

Submit an NPS rating​

/i/feedback/inputs?
app_key=YOUR_APP_KEY&
device_id=device_123&
events=[{"key":"[CLY]_nps","count":1,"segmentation":{"widget_id":"65f0cbf8bca6b8e8fbf7f901","rating":9}}]

Response​

Success Response​

The response is produced by the regular /i data ingestion.

{
"result": "Success"
}

Error Responses​

  • 400
{
"result": "invalid_event_request"
}
  • 400
{
"result": "Invalid nps/survey events"
}
  • 400
{
"result": "Missing parameter \"app_id\" or \"app_key\""
}
  • 400
{
"result": "Cannot resubmit nps/survey"
}

Behavior​

Behavior Modes​

ModeConditionResult
AcceptedEvent is allowed for this user and widget.Event is passed on to /i ingestion and its response is returned.
Resubmission blockedThe user has already completed the widget (or closed it, when the widget is set to show until closed) and the event is a rating or an answer.Returns 400 with Cannot resubmit nps/survey.
Always showThe widget's appearance is set to always show.Resubmission is allowed.
Journey-driven surveyThe event refers to a running survey block of the same user and widget.Resubmission check is skipped.

Impact on Other Data​

  • Accepted events are recorded through the regular /i ingestion.