Webhook Delivery - Data Structure by Question Type

View the structure of webhook data deliveries based on question type

Now that we understand the basics of webhooks, how to set them up and their general delivery structure let's dig a little bit deeper into webhook delivery by question type. 

As you probably already read, the data we deliver through your webhook follows a standard structure however, the response structure can vary slightly by question type. Below you will find each of the different possible data structures by question type. 

Multi Choice, Image Choice Questions:

Multi choice and image choice questions are structured the same, the only difference between the two question types will be the question "type"

{  
"has_variants": true or false,
"id":####,
"name":"Question Text”,
"questions": [
        {
        "answers": [
            {
        "comment": "",
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    “id":####,
                    "name": "Answer Choice",
                    "tag": null
          },
          “updated": “YYYY-MM-DDT00:00:00.000000+00:00"
          }
     ],
     "id":####,
     "tag": null
     "text": "Question Text"
      }
     ],
      "tag": null,
      "type": "ImageChoiceQuestionPage"
    },

Type: 

  • Image Choice: ImageChoiceQuestionPage
  • Multiple Choice

Single Rating, Opinion Scale (Likert), Slider, NPS

{  
   "has_variants": true/false,
   "id":####,
   "name":"Question Text”,
   "questions": [
   {
        "answers": [
        {
            "comment": "",
            "created": "YYYY-MM-DDT00:00:00.000000+00:00",
            "id": ####,            
            "updated": "YYYY-MM-DDT00:00:00.000000+00:00",
            "value": Rating (Numerical)
    }
  ],
       "id":####,
       "tag": null
       "text": "Question Text"
    }
   ],
   "tag": null,
   "type": "RatingQuestionPage"
    },

Type: 

  • Single Rating: RatingQuestionPage
  • Opinion Scale: LikertQuestionPage
  • Slider: SliderQuestionPage
  • NPS: NPSQuestionPage

Multi Rating

  {
    "has_variants": true/false,
    "id":####,
    "name":"Question Text”,
    "questions": [
  {
        "answers": [
      {
            "comment": "Comment Response Text",
            "created": "YYYY-MM-DDT00:00:00.000000+00:00",
            "id": ####,            
            "subject": {
                "id": ####,
                "name": " Subject Text ",
                "tag": null
            },
            "updated": “YYYY-MM-DDT00:00:00.000000+00:00",
            "value": Rating (Numerical)
            },
            {
            "comment": "Comment Response Text",
            "created": "YYYY-MM-DDT00:00:00.000000+00:00",
            "id": ####,            
            "subject": {
                        "id": ####,
                        "name": " Subject Text ",
                "tag": null
             },
            "updated": “YYYY-MM-DDT00:00:00.000000+00:00",
            "value": Rating (Numerical)
            },
      ],
           "tag": null,
           "type": "RatingMatrixQuestionPage"
    },

Ranking


    {
 {  
"has_variants": true/false,
"id":####,
"name":"Question Text”,
"questions": [
        {
          "answers": [
            {
          "comment": "",
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    “id":####,
                    "name": "Answer Choice",
                    "tag": null
          },
          "order": Ranking Place (Numerical),
          "updated": "YYYY-MM-DDT00:00:00.000000+00:00"
      },
      {
          "comment": "",
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    “id":####,
                    "name": "Answer Choice",
                    "tag": null
          },
          "order": Ranking Place (Numerical),
          "updated": "YYYY-MM-DDT00:00:00.000000+00:00"
      }
   ],
   "id":####,
   "tag": null
   "text": "Question Text"
  }
  ],
  "tag": null,
  "type": "RankingQuestionPage"

Long, Short and Numerical Open Ended:

{  
"has_variants": true/false,
"id":####,
"name":"Question Text”,
"questions": [
        {
          "answers": [
      {
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "updated": “YYYY-MM-DDT00:00:00.000000+00:00",
          "value": "Answer response text"
            }
        ],
        "id":####,
        "tag": null
        "text": "Question Text"
        }
      ],
      "tag": null,
      "type": "LongOpenQuestionPage"
    },

Type: 

  • Long: LongOpenQuestionPage
  • Short:
  • Numerical

Choice Grid (Matrix):

{
"has_variants": true/false,
"id":####,
"name":"Question Text”,
"questions": [
        {
          "answers": [
      {
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    "id": ####,
                    "name": "Answer Choice Text (Column)",
                    "tag": null
              },
          "subject": {
                    "id": ####,,
                    "name": "<div>Subject Name</div>",
                    "tag": null
        },
          "updated": “YYYY-MM-DDT00:00:00.000000+00:00"
        },
        {
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    "id": ####,
                    "name": "Answer Choice Text (Column)",
                    "tag": null
     },
          "subject": {
                    "id": ####,,
                    "name": "<div>Subject Name</div>",
                    "tag": null
     },
          "updated": " YYYY-MM-DDT00:00:00.000000+00:00"
     },
    ],
         "id":####,
         "tag": null
         "text": "Question Text"
     }
     ],
       "tag": null,
       "type": "ItemMatrixQuestionPage"
    },

Choice Group Question, Demographics Page 

Multi choice and image choice questions are structured the same, the only difference between the two question types will be the question "type"

{  
"has_variants": true/false,
"id":####,
"name":"Question Text”,
"questions": [
        {
          "answers": [
            {
          "comment": "",
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    “id":####,
                    "name": "Answer Choice",
                    "tag": null
              },
          “updated": “YYYY-MM-DDT00:00:00.000000+00:00"
}
          ],
          "id":####,
          "tag": null
          "text": "Subject Name"
        },
        {
          "answers": [
            {
          "comment": "",
          "created": "YYYY-MM-DDT00:00:00.000000+00:00",
          "id": ####,            
          "item": {
                    “id":####,
                    "name": "Answer Choice",
                    "tag": null
              },
          “updated": “YYYY-MM-DDT00:00:00.000000+00:00"
}
          ],
          "id":####,
          "tag": null
          "text": "Question Text"
      }
      ],
      "tag": null,
      "type": "DemographicsQuestionPage"
    },

Type: 

  • Choice Group: ChoicesGroupQuestionPage 
  • Demographics: DemographicsQuestionPage

Image Upload

{
  "has_variants": true/false,
  "id": ####,
  "name": "Question Text",
  "questions": [
    {
      "answers": [
        {
          "comment": "Comment Text",
          "created": “YYYY-MM-DDT00:00:00.000000+00:00",
            "id": ####,
            "updated": “YYYY-MM-DDT00:00:00.000000+00:00",
            "value": "imageURL"
        }
      ],
      "id": ####,
      "tag": null,
      "text": "Question Text"
    }
  ],
  "tag": null,
  "type": "ImageUploadQuestionPage"
},

Contact Form

Some fields on a contact form might have a numerical or date value sent as their question response depending upon which field type was included on the page. 

Below is an example of a Contact Page with a checkbox included, if the Contact Page does not have a checkbox the delivery will start with the following:

"has_variants":
{  
         "checkboxes":[  
            {  
               "accepted":true,
               "date":"2018-11-11T12:05:12.908000+00:00",
               "text":"Contact Checkbox"
            }

],
   "has_variants": true/false,
   "id": ####,
   "name": "Question Text",
   "questions": [
     {
       "answers": [
         {
           "created": "YYYY-MM-DDT00:00:00.000000+00:00",
           "id": ####,
           "updated": "YYYY-MM-DDT00:00:00.000000+00:00",
              "value": "Question Response"
            }
          ],
          "id": ####,
          "tag": null,
          "text": "Subject Text"
        },
        {
       "answers": [
         {
           "created": "YYYY-MM-DDT00:00:00.000000+00:00",
           "id": ####,
           "updated": "YYYY-MM-DDT00:00:00.000000+00:00",
           "value": "Question Response"
         }
       ],
       "id": ####,
       "tag": null,
       "text": "Subject Text"
     }
  ],
   "tag": null,
   "type": "ContactInfoQuestionPage"
 },

 


Important Notes:

  • Labels : Where "tag": is listed as null, if you have added a label to any of the survey elements, null will be replaced with the label's text
  • Variants : Where "has_variants" is listed as "true" the following will be included at the end of the relevant question page delivery after the question type:
"variant_id": 51526,       
"variant_name": "Variant Two"
  • Welcome Page checkbox values are not sent with Webhook deliveries

Learn about other integrations available between Segmanta and external applications.