I can belatedly add a few extra tips:
To get data for one or more named LSOAs ....
http://data.ons.gov.uk/ons/api/data/dataset/QS201EW.json?dm/2011STATH=E01008397,E01008396&apikey=12345&jsontype=json-stat&totals=false&context=Census&geog=2011STATH
To get all the LSOAs within an LA
http://data.ons.gov.uk/ons/api/data/dataset/QS201EW.json?pdm/E08000021=LSOA&apikey=12345&jsontype=json-stat&totals=false&context=Census&geog=2011STATH
This uses the alternative pdm/{parent area code}={list of child area types} syntax.
The parent area code can also be a grandparent or older ancestor. You can get the codes for potential parent areas with a call like this
http://data.ons.gov.uk/ons/api/data/hierarchy/QS601EW.xml?context=Census&apikey=12345&geog=2011WARDH&levels=0,1,2,3,4,5,6
Another PDM Example: Get a count of males for all the local authorities (of any type) within South East region and return as JSON-Stat:
http://data.ons.gov.uk/ons/api/data/dataset/QS104EW.json?context=Census&apikey=12345&geog=2011WARDH&totals=true&jsontype=json-stat&dm/CL_0000035=CI_0000071&pdm/E12000008=NMD,UA,LONB,MD
Note that an alternative to using the NeSS service to get an area for a postcode, you can use ArcGIS. First a call to the ESRI world service to get the x and y coordinates of a postcode or placename, then do a query against the ONS ArcGIS service to return the name / code of admin area it falls within:
function getCentroid() {
var searchstring = document.getElementById("postcodeorplace").value;
var testURL = "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=" +
searchstring + "&outFields=*&bbox=%20-5.4188710000000002,49.865400000000001,%201.7641,55.813870000000001&sourceCountry=GBR&outSR=27700&f=json&maxLocations=6";
getJSONResponse1(testURL);
}
function getExtCode() {
var layer = document.getElementById("layerpicker");
var layerval = layer.options[layer.selectedIndex].value;
var xpos = document.getElementById("xcoord").value;
var ypos = document.getElementById("ycoord").value;
var testURL = "http://services1.arcgis.com/ESMARspQHYMw9BZ9/ArcGIS/rest/services/" + layerval + "/FeatureServer/0/query?returnGeometry=false&outFields=*&geometryPrecision=0&f=json&geometry=" +
xpos + "," + ypos + "&geometryType=esriGeometryPoint&inSR=27700"
getJSONResponse2(testURL);
}