ipOne API Documentation


survey/get_survey

Important:  An API Key is required to work with these API Calls

Returns the details of a chosen survey including groups and questions

Sample Request

http://api.verifiapp.com/survey/get_survey/{API-KEY}/{SURVEY-ID}

Sample Response

{ result: "success" -results: { id: "1" survey_title: "sample survey title 1" -groups: [ +{ … } +{ … } ] } }

(View a sample screenshot)

Successful response reference

A successful response will return the following items in a JSON array

Preference Description Default value Notes
result success    
results An array containing the following information:    
  id The unique survey ID   Use 'list_all' to retrieve a list of survey IDs
  survey_title The Title of the survey    
  groups An array of the question groups within the current survey   See the 'Group Response Reference' table below for more details

'Group' response reference

A question group is returned as part of the Survey response. There is currently no limit to the number of Groups within a survey.

Preference Description Default value Notes
id The unique group ID    
group_title The title of the group    
questions An array of the questions within the current group   See the 'Questions Response Reference' table below for more details about the items in this array

'Questions' response reference

A set of questions is returned as part of a Group. There is currently no limit to the number of Questions within a Group.

Preference Description Default value Notes
id The unique question ID    
alert_type An alert type   Some question answers may need to trigger an email or SMS message.
question The actual question to be answered    
answer_type The type of answer required from the user   textarea, text, integer_list, option, workcodes, date
multiple_choice If it can be answered with multiple answers   0 or 1 - 1 means an answered is Required
required An answer must be provided   0 or 1 - 1 means an answered is Required
answer_type The type of answer required from the user   text, integer_list, option, workcodes, date
answer_options Options to be used with answer_top 'integer_list', 'options' and 'workcodes'    
requires_photo Tells if a photo is required for this answer    
requires_comments Tells if additional comments are required for the answer    
description_codes If the answer_type is 'workcodes', it'll return an array of the description for each code. The index "code" will have the workcode and "description" the textual description of the code.    
NEW FIELDS:      
dependency Array   Array with the list of dependecies to show or not this question on the form. It's the list of answers the technician must select to show the current question.
Each array item has:      
question_id The question that must be answered to display this question on the form.   This SHOULDN'T be used to display the question, this is only a value that may help to prepare the system to display the question internally or for design/layout purposes. To display a question or not, you should use the answer_id
answer_id The answer ID that must be ansered to display this question on the form.   This value is the one you should use to show a question or not. The idea is to show a question or other depending on the answer of a question.

Unsuccessful Response Reference

A unsuccessful response will return the following items in a JSON array

Preference Description Sample response
result error  
error The specific failure is described in the response Missing API Key