Version 1 - Dataset Codebook

Released At: 29 Apr 2015Last Updated At: 02 Nov 2015

Get the codebook for a dataset.

URL

To call this method, use an HTTP GET request to the following URL:

http://data.unicef.ge/[locale]/api/v1/dataset_codebook

where:

  • [locale] = the locale of the language you want the data to be returned in (currently ka for Georgian or en for English)

Required Parameters

The following parameters must be included in the request:

ParameterDescription
access_token All requests must include an access_token. You can obtain an access token easily, and for free, by going here.
dataset_id The ID of the dataset.

Optional Parameters

There following parameters are optional for this call.

ParameterDescription
language Code of the language to return the dataset information in (e.g., en for English). If language is not provided, the default language of the dataset will be used.

What You Get

The return object is a JSON array of the dataset questions and answers with the following information:

ParameterDescription
code Code of the question. Youwill use this valueto run an analysis.
original_code The original code from the datasource. The difference between the code and original_code is that the code is lower case and has '.' replaced with '|'.
text The question text
notes Any special notes about the question
is_mappable A boolean flag indicating if this question has been assigned to map shapes
answers

An array of the possible answers with the following values:

  • value - the answer value
  • text - the answer text
  • can_exclude - boolean flag indicating if this answer can be excluded from analysis
  • sort_order - order in which the answer should appear

Examples

Here is an example of what can be returned after calling this method with the following url:

http://data.unicef.ge/en/api/v1/dataset_codebook?access_token=123456789&dataset_id=1111111111
{
  questions: [
    {
      code: "gender",
      original_code: "GENDER",
      text: "What is your gender?",
      is_mappable: false,
      answers:[
        {
          value: "1",
          text: "Male",
          can_exclude: false,
          sort_order: 1
        },
        {
          value: "2",
          text: "Female",
          can_exclude: false,
          sort_order: 2
        },
        {
          value: "3",
          text: "Refuse to Answer",
          can_exclude: true,
          sort_order: 3
        }
      ]
    },
    {
      code: "live",
      original_code: "LIVE",
      text: "Where do you live?",
      is_mappable: false,
      answers:[
        {
          value: "1",
          text: "Tbilisi",
          can_exclude: false,
          sort_order: 1
        },
        {
          value: "2",
          text: "London",
          can_exclude: false,
          sort_order: 2
        },
        {
          value: "3",
          text: "New York City",
          can_exclude: false,
          sort_order: 3
        }
      ]
    },
    {
      code: "age",
      original_code: "AGE",
      text: "What is your age?",
      is_mappable: false,
      answers:[
        {
          value: "1",
          text: "< 18",
          can_exclude: false,
          sort_order: 1
        },
        {
          value: "2",
          text: "18-65",
          can_exclude: false,
          sort_order: 2
        },
        {
          value: "3",
          text: "> 65",
          can_exclude: false,
          sort_order: 3
        }
      ]
    }
  ]
}