-
Notifications
You must be signed in to change notification settings - Fork 1
Developer documentation
To integrate with Tally (a platform to build and share forms), our application provides a custom class (TallyForm
). This class is able to validate forms and transform them to a more suitable object from which other (model) objects can be created (as demonstrated in the tallyregistration
endpoint).
To validate and transform a Tally form, a JSON file with rules about the structure of the form is used. We call this the questions file.
root
|
|- index
| |- question
| |- attributes
|- index
| |- question
| |- attributes
|- ...
The questions file consists of multiple indexed question
objects (each with their own unique attributes). TallyForm
compares these objects against the questions in the Tally form and transforms them where necessary.
{
"0": {
"question": [
"Are there any responsibilities you might have which could hinder you during the day?"
],
"field": "hinder_work",
"type": "TEXTAREA",
"required": false
},
"0": {
"question": [
"Birth name"
],
"field": "first_name",
"type": "INPUT_TEXT",
"required": true
}
}
Example of a questions file with two questions.
A question object can have different attributes. Some attributes are required and others are optional.
Type: List:String
, Required: True
Type: String
, Required: True
Type: List:String|String
, Required: True
- value
- answers
- answer
Type: Bolean
, Required: True