Skip to main content

Surveys - Question Map

Endpoint

/o/surveys/survey/question_map

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Returns survey question schema map by widget ID(s).

Authentication

Authentication methods:

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Surveys: Read permission.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID
widget_idsString (JSON Array/String)NoWidget ID list or single ID

Response

Success Response

{
"67b9db56f67aab0012cd8899": {
"name": "Product Feedback",
"q1": {
"name": "How can we improve?",
"type": "text"
},
"q2": {
"name": "How satisfied are you?",
"type": "radio",
"choices": {
"1": "Very satisfied",
"2": "Satisfied"
}
}
}
}

Response Fields

FieldTypeDescription
<widgetId>ObjectWidget question mapping
<widgetId>.nameStringWidget name
<widgetId>.<questionId>ObjectQuestion metadata

Error Responses

  • HTTP 500 - Query failure:
{
"result": "Error finding survey widgets"
}

Behavior/Processing

  • Reads Survey widgets (type=survey) for the requested app_id.
  • If widget_ids is provided, parses it as JSON. It can be a widget ID string or an array of widget IDs.
  • Invalid widget_ids JSON is logged; the endpoint continues with the base app/type query.
  • Builds a map keyed by widget ID. Each widget entry includes name and one entry per question ID.
  • Each question entry includes question text as name, question type, and optional choices converted from an array into a key-value object.

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.

Examples

/o/surveys/survey/question_map?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID
/o/surveys/survey/question_map?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_ids=["67b9db56f67aab0012cd8899"]

Ⓔ Enterprise

This feature is part of Countly Enterprise.

Get Access:

Already a Customer? Use support portal if you have any questions.


Last Updated

2026-04-18