API
Last updated
//You can fetch the above created survey via this API.
GET "/survey/:survey_id/config"
{
"data": {
"survey": {
"survey_name": "Testing Template",
"created_at": "2024-04-24T17:41:43.466Z",
"survey_id": "s-id value"
},
"questions": [
{
"properties": {
"labels": {
"left": "left label value",
"right": "right label value"
},
"randomize": "in_set",
"options": []
},
"question_text": "Your first question!",
"question_desc": "Tip1: You can change the colors of this widget from the Setting tab.",
"question_order": 1,
"question_type": "scale_feedback"
},
...
]
}
}
Select Based Questions
'multi_select_feedback'
'single_select_feedback'
Range-Based Question [0-10]
'nps_feedback'
Range-Based Question [1-5]
'scale_feedback'
'star_feedback'
'emoji_feedback'
Text-Based Question
'input_feedback'
'data_collection'
Click-Based Question
'intro_prompt'POST "/survey/:survey_id/response"
{
"user_id": "user_id", //string
"group_id": "g-id", // id to indentify a individual user response collection.
"question_order": 1, //int value
"user_response": "Great" // user response with data type number/string/array
}
User Response Datatype
number - Range [1 - 5] rating scale, star, emoji responses
Eg. "user_response": 1
number - Range [0 - 10] NPS responses
Eg. "user_response": 10
text-- text-based questions
Eg. "user_response": "Great"
array -- select based questions
Eg. "user_response": ["Option A", "Option B"]group_id has to be unique for each survey user response collection.
Don't duplicate any user response.This has to be generated from the client side
(preferably uuid string).