You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 4 Next »
This edge is only active for the instances that have the survey module active.
If it's not active, all endpoints will return a success = 0 message.
Returns the default feedback survey link.
GET /survey/default_scale
Request
Method: GET
Only logged in: YES
Headers:
X-Requested-With
Response
Description
200
{ "success": 1, "message": "link_to_survey" }
Success response
Base object:
403
Forbidden
Returns the survey data for the currently assigned scale or assigns a new one if a link is given.
GET /survey/get
Parameters:
{ "success": 1, "instance_id": 28, "scale": { "id": 15, "title": "Feedback form", "description": "<p>Please fill out this feedback form!</p>", "type": 2 }, "items": [ { "id": 20, "title": "What do you think about our gym?", "position": 1, "answers": { "2": { "id": 2, "title": "Goodn't :(", "position": 1, "value": 0 }, "13": { "id": 13, "title": "Good", "position": 2, "value": 0 } }, "actual_answer": "", "actual_value": "" }, { "id": 21, "title": "What do you think about our offers?", "position": 2, "answers": { "2": { "id": 2, "title": "Goodn't :(", "position": 1, "value": 0 }, "13": { "id": 13, "title": "Good", "position": 2, "value": 0 } }, "actual_answer": "", "actual_value": "" } ] }
scale object:
Internal type of the survey:
items object:
Array of answers for the survey item
If it's empty, the user should be able to type in any response he wants.
An old answer given to that item (in case the user abandoned the survey before and now it came back)
Internal form - Mosly as an ID, used mostly for fixed answer questions
Human readable form - Mostly as a text, used for open response questions
answers object:
Object of type ID - Properties
Internal value of the answer
POST /survey/save
Method: POST
Array of answer objects with the survey responses.
Answer object description:
Survey answer ID
Used when the answer array is not empty when getting the survey data - Fixed answer question
Survey answer - Plain text
Used when the answer array is empty when getting the survey data - Open response question
{ "success": 1, }