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 |
|
type | Integer | Type of question:
|
question | Object | An object containing the text for the question in multiple locales. e.g.
|
answers | Object[] | An array of answer objects.
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:
|
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" ]
}