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:
Readpermission.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or auth_token) | API key authentication |
auth_token | String | Yes (or api_key) | Auth token authentication |
app_id | String | Yes | App ID |
widget_ids | String (JSON Array/String) | No | Widget 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
| Field | Type | Description |
|---|---|---|
<widgetId> | Object | Widget question mapping |
<widgetId>.name | String | Widget name |
<widgetId>.<questionId> | Object | Question metadata |
Error Responses
- HTTP 500 - Query failure:
{
"result": "Error finding survey widgets"
}
Behavior/Processing
- Reads Survey widgets (
type=survey) for the requestedapp_id. - If
widget_idsis provided, parses it as JSON. It can be a widget ID string or an array of widget IDs. - Invalid
widget_idsJSON is logged; the endpoint continues with the base app/type query. - Builds a map keyed by widget ID. Each widget entry includes
nameand one entry per question ID. - Each question entry includes question text as
name, questiontype, and optionalchoicesconverted from an array into a key-value object.
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.feedback_widgets | Endpoint data source | Stores 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"]
Related Endpoints
Ⓔ 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