JSON Configuration Files

We designed our system in such a way that everything related to a survey both in the front- and the backend is generated from a single configuration in JSON format, which we simply call survey configuration.

Here you can see a very simple survey that asks your survey participants to describe why they like ice cream, should be simple right?

{
"survey_name": "text",
"title": "Text Test",
"description": "",
"start": 0,
"end": 4102444800,
"draft": false,
"authentication": "open",
"limit": 0,
"fields": [
{
"type": "text",
"title": "Why do you like ice cream?",
"description": "",
"min_chars": 10,
"max_chars": 1000
}
]
}

Each survey configuration has the same top level properties:

  • survey_name: the name of the survey
  • title: the (more detailed and readable) title of the survey
  • description: here you can put a short description or introduction of the survey
  • start: the time the survey is opened as unix timestamp
  • end: the time the survey is closed as unix timestamp
  • draft: if the survey is a draft, meaning that it's not (yet?) public
  • authentication: the submission authentication type of the survey
    • open: a free for all survey, everyone who has the link can submit (even multiple times)
    • email: a survey where the user submits their email address during the survey and we verify that the email is valid via a confirmation email (only the user's most recent submission counts)
  • limit: an optional submission count limit in order to keep costs in check; 0 for the maximum limit of 65536 (for now, later this will mean no limit at all); when no payment info is provided 0 means a limit of 100 submissions
  • fields: a list of the questions that the survey entails, see Field Types

The exact rules for the configuration parameters are as follows:

  • survey_name [string]: ^[a-z0-9-]{2,20}$, must be unique for the user
  • title [string]: 1 <= title.length <= 128
  • description [string]: 0 <= description.length <= 4096
  • start [integer]: 0 <= start <= end
  • end [integer]: start <= end <= 4102444800
  • draft [boolean]
  • authentication [string]: one of [open, email]
  • limit[integer]: 0 <= limit <= 65536, when payment info is provided otherwise 0 <= limit <= 100 (free tier)
  • fields [list]: 1 <= fields.length <= 128, if authentication == email this must include exactly one email field, otherwise no email field at all