Datapoint API

This API is used to obtain all of the questions and answers for a datapoint.

Command

"client/datapoint/1"



Inputs

The following values are expected in the JSON body:

Name Type Required Description
command String

Must be "client/datapoint/1"

name String

The datapoint name.


Outputs

The JSON output will always contain the original command and a result. If the result > 0, an error has occurred (refer to Error Codes) and a message field will describe the error. If result = 0, the following is included in the response field:

Name Type Description
name String

The datapoint name

property String

The property name

mode Integer
  1. profile question - asked once per respondent, response should never change. (ie. ethnicity)

  2. screener question - asked once per session, response will change over time (ie. Which parks did you visit in the past 30 days?)

type Integer

Type of question:

  • 0 - Radio Button (Single Selection)
  • 1 - Checkbox (Multiple Selection)
  • 2 - Dropdown (Single Selection)
  • 11 - list
  • 12 - listOther
  • 13 - choice
  • 14 - choiceOther
  • 15 - age
  • 16 - freelist
  • 17 - child
question Object

An object containing the text for the question in multiple locales. e.g.

{
     "en-US" : "How many DVDs/Blu-rays do you purchase on a monthly basis (on average)?",
     "en-GB" : "How many DVDs/Blu-rays do you purchase on a monthly basis (on average)?",
     "de-DE" : "Wie viele DVDs oder Blu-ray Discs kaufen Sie normalerweise in einem Monat?",
     "fr-FR" : "Combien de DVD et de Blue-rays achetez-vous chaque mois (en moyenne) ?",
     "en-CA" : "How many DVDs/Blu-rays do you purchase on a monthly basis (on average)?"
}
answers Object[]

An array of answer objects.

[
     null,
     {
          "en-US" : "0",
          "disposition" : 1,
          "en-GB" : "0",
          "de-DE" : "0",
          "fr-FR" : "0",
          "en-CA" : "0"
     }, {
          "en-US" : "1 to 3",
          "disposition" : 1,
          "en-GB" : "1 to 3",
          "de-DE" : "1 bis 3",
          "fr-FR" : "4 à 6",
          "en-CA" : "1 to 3"
     }, {
          "en-US" : "4 to 6",
          "disposition" : 1,
          "en-GB" : "4 to 6",
          "de-DE" : "4 bis 6",
          "fr-FR" : "7 à 10",
          "en-CA" : "4 to 6"
     }, {
          "en-US" : "7 to 10",
          "disposition" : 1,
          "en-GB" : "7 to 10",
          "de-DE" : "7 bis 10",
          "fr-FR" : "7 à 10",
          "en-CA" : "7 to 10"
     }, {
          "en-US" : "11 or more",
          "disposition" : 1,
          "en-GB" : "11 or more",
          "de-DE" : "11 oder mehr",
          "fr-FR" : "11 ou plus",
          "en-CA" : "11 or more"
     }
]

The index of the answer is the numeric code for that answer. ie. "4 to 6" is answer #3. Note that the 0 th answer is typically null, so the first answer starts with 1. The disposition values for each answer are:

  1. Mandatory
  2. Mandatory, at end of list
  3. Omit
  4. Exclusive
  5. Exclusive, at end of list
countries String[]

The array contains the ISO codes of the countries that are supported by this datapoint.



Example Response

response: {
     answers: [
          null,
          {
               "en-US": "Yes",
               "disposition": 0
          },
          {
               "en-US": "No",
               "disposition": 0
          }
     ],
     mode: 1,
     name: "RFG2_Vote",
     property: "rfg2_634",
     question: {
          "en-US": "Are you registered to vote?"
     },
     type: 0,
     countries : [ "US" , "VN" ]
}