Rest - Evidence - Questionnaires
Purpose
This API is used for creating, editing and deleting questionnaires from the Views system. It is not a way to submit questionnaire answer data. That is done via the other various sections.
Base URL
https://app.viewsapp.net/api/restful/evidence/questionnaires
Schema
https://app.viewsapp.net/api/restful/evidence/questionnaires/schema(.xml|.json|.xsd)
Searching for available Questionnaires
curl --url <Base URL>/search?q=<query> -u<username>:<password> -H Content-Type:text/xml
- query - This is a text string to use to search for in the venues records
You can search for any field for a specific value by setting the field as a parameter. Please refer to the schema for field names.
Fetching a Questionnaire's details
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml
- id - The id of the Questionnaire
This will also return all enabled questions for the specified questionnaire.
Creating a Questionnaire
curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X POST -d '<xml>'
<questionnaire> <Title>Questionnaire Title</Title> <Description>A description of the questionnaire</Description> </questionnaire>
Currently the creation of questionnaires is a two stage process. Create the questionnaire overview and then add the questions. It is possible that we will in the future, add the ability to submit a complete questionnaire data structure from this call. For more information about applying questions to a Questionnaire, please refer to the Questionnaire - Questions API
Updating a Questnnaire
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>'
- id - The id of a Questionnaire
By passing the the same xml structure as creating a questionnaire, you are able to update the overview information. To archive the questionnaire, use the following:
curl --url <Base URL>/<id>/archive -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<xml>'
and pass the following XML:
<archive>1</archive>
<archive>0</archive>
Deleting a Questionnaire
This method will completely wipe the question and all associated data, including the answers. You should be very careful when using this method.
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X DELETE