Skip to content

Backend Design Doc

Kartik Verma edited this page Sep 6, 2016 · 1 revision

Schema

Questionnaire

APIs:

  • GET /questionnaires Response:
{
  questionnaires: [
    {
      id: 1,
      about: "",
      answered: true
    },
    ...
  ]
}
  • GET /questionnaire/:id

Response:

{
  questionnaire: {
    id: 1,
    about: "",
    description: "",
    questions: [
      {
        id: 1,
        label: "",
        image: "",
        description: "",
        required: true,
        questionType: {
         id: 1,
         label: ""
        },
        options: [
         {
           id: 1,
           image: "",
           label: "",
           description: ""
         },
         ...
        ]
      },
      ...
    ]
  }
}
  • POST /questionnaire/:id

Request:

{
  questionnaire: {
    id: 1,
    questions: [
      {
        id: 1,
        answer: {
         optionId: 1,
         optionIds: [],
         text: ""
        }
      },
      ...
    ]
  }
}
Clone this wiki locally