States of every country request - variables

Name Type Description
status Boolean Determines if result has any valid airports. False means no airports will be in the response.
statusCode Integer This will be a number corresponding to the response code type.
district_type String This will let you know what type of district your requested country has. For instance, United States has States, Canada has provinces, United Kingdom has counties, etc.
states String The states variable can be either an array of states objects, or a string of options for a select field. Your 'is_select_options' parameter will determine what will be in this variable.

Example response

The response will be in typical json fashion. The following response is for Australia (country='au').

{
  "status": true,
  "statusCode": 200,
  "district_type": "State",
  "states": [
    {
      "abbr": "ACT",
      "name": "Australian Capital Territory",
      "region": ""
    },
    {
      "abbr": "NSW",
      "name": "New South Wales",
      "region": ""
    },
    {
      "abbr": "NT",
      "name": "Northern Territory",
      "region": ""
    },
    {
      "abbr": "QLD",
      "name": "Queensland",
      "region": ""
    },
    {
      "abbr": "SA",
      "name": "South Australia",
      "region": ""
    },
    {
      "abbr": "TAS",
      "name": "Tasmania",
      "region": ""
    },
    {
      "abbr": "VIC",
      "name": "Victoria",
      "region": ""
    },
    {
      "abbr": "WA",
      "name": "Western Australia",
      "region": ""
    }
  ]
}

If you set 'is_select_options' to true then your countries variable will be a string of options similar to this.

{
  "status": true,
  "statusCode": 200,
  "countries": "<option value=\"ACT\">Australian Capital Territory</option>
                <option value=\"NSW\">New South Wales</option>
                <option value=\"NT\">Northern Territory</option>
                <option value=\"QLD\">Queensland</option>
                ...
                <option value=\"WA\">Western Australia</option>"
}