Rest - Evidence - Questionnaires: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
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. | 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=== | ===Base URL=== | ||
https://app.viewsapp.net/api/restful/evidence/questionnaires | |||
===Schema=== | ===Schema=== | ||
<nowiki> | <nowiki>https://app.viewsapp.net/api/restful/evidence/questionnaires/schema(.xml|.json|.xsd)</nowiki> | ||
==Searching for available Questionnaires== | ==Searching for available Questionnaires== | ||
Line 23: | Line 21: | ||
This will also return all enabled questions for the specified 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 [[Rest - Evidence - Questionnaires - Questions|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== | |||
<font color="red">'''This method will completely wipe the question and all associated data, including the answers. You should be very careful when using this method.'''</font> | |||
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X DELETE |
Latest revision as of 13:07, 26 February 2016
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