Back to topic listing
Previous thread
Next thread
-
From: Ian Bicking
Subject: DC API
Date: Jun 22, 2009 04:52 PM
OK, this is just weird; you get this list of descriptions: http://api.dc.gov/open311/v1/meta_getTypesList.json And this is the result: {"servicetypeslist": [{"servicetype": [{"servicetype": "Abandoned Bicycles"}, {"servicecode": "S0021"}]}, {"servicetype": [{"servicetype": "Abandoned Vehicles"}, {"servicecode": "S0000"}]}, {"servicetype": [{"servicetype": "Alley Cleaning"}, {"servicecode": "S0011"}]}, {"servicetype": [{"servicetype": "Alley Lights"}, {"servicecode": "S05AL"}]}, {"servicetype": [{"servicetype": "Alley Repair"}, {"servicecode": "S0016"}]}, {"servicetype": [{"servicetype": "Autumn Leaf Collection"}, {"servicecode": "S0196"}]}, {"servicetype": [{"servicetype": "Bulk Collection"}, {"servicecode": "S0031"}]}, {"servicetype": [{"servicetype": "Curb & Gutter Repair"}, {"servicecode": "S0081"}]}, {"servicetype": [{"servicetype": "Dead Animal"}, {"servicecode": "11"}]}, {"servicetype": [{"servicetype": "Eviction"}, {"servicecode": "S0146"}]}, {"servicetype": [{"servicetype": "Graffiti"}, {"servicecode": "GRAFF"}]}, {"servicetype": [{"servicetype": "Grass & Weeds Mowing"}, {"servicecode": "S0166"}]}, {"servicetype": [{"servicetype": "How Am I Driving? (Complaint)"}, {"servicecode": "HMDCP"}]}, {"servicetype": [{"servicetype": "How Am I Driving? (Compliment)"}, {"servicecode": "HMDCM"}]}, {"servicetype": [{"servicetype": "Illegal Dumping"}, {"servicecode": "S0181"}]}, {"servicetype": [{"servicetype": "Litter Can Service or Repair"}, {"servicecode": "S0217"}]}, {"servicetype": [{"servicetype": "Parking Enforcement"}, {"servicecode": "S0261"}]}, {"servicetype": [{"servicetype": "Parking Meter Damage"}, {"servicecode": "S0277"}]}, {"servicetype": [{"servicetype": "Parking Meter Repair"}, {"servicecode": "S0276"}]}, {"servicetype": [{"servicetype": "Parking Meters"}, {"servicecode": "0"}]}, {"servicetype": [{"servicetype": "Pavement Markings"}, {"servicecode": "S0291"}]}, {"servicetype": [{"servicetype": "Potholes"}, {"servicecode": "S0301"}]}, {"servicetype": [{"servicetype": "Rat Abatement"}, {"servicecode": "S0311"}]}, {"servicetype": [{"servicetype": "Recycling Bin"}, {"servicecode": "S0316"}]}, {"servicetype": [{"servicetype": "Recycling Collection"}, {"servicecode": "S0321"}]}, {"servicetype": [{"servicetype": "Residential Parking Permit"}, {"servicecode": "RPP"}]}, {"servicetype": [{"servicetype": "Sanitation Enforcement"}, {"servicecode": "S0346"}]}, {"servicetype": [{"servicetype": "ServiceType"}, {"servicecode": "ServiceCode"}]}, {"servicetype": [{"servicetype": "Sidewalk Repair"}, {"servicecode": "S0361"}]}, {"servicetype": [{"servicetype": "Signs - Parking"}, {"servicecode": "S0286"}]}, {"servicetype": [{"servicetype": "Signs - Street Name"}, {"servicecode": "S0371"}]}, {"servicetype": [{"servicetype": "Street Cleaning"}, {"servicecode": "S0391"}]}, {"servicetype": [{"servicetype": "Street Repair"}, {"servicecode": "S0406"}]}, {"servicetype": [{"servicetype": "Streetlight Repair"}, {"servicecode": "S05SL"}]}, {"servicetype": [{"servicetype": "Supercan"}, {"servicecode": "S0421"}]}, {"servicetype": [{"servicetype": "Traffic Signals"}, {"servicecode": "S0436"}]}, {"servicetype": [{"servicetype": "Traffic Signs"}, {"servicecode": "S0376"}]}, {"servicetype": [{"servicetype": "Trash Collection"}, {"servicecode": "S0441"}]}, {"servicetype": [{"servicetype": "Tree Emergency"}, {"servicecode": "S0457"}]}, {"servicetype": [{"servicetype": "Tree Maintenance"}, {"servicecode": "S0456"}]}, {"servicetype": [{"servicetype": "Tree Planting"}, {"servicecode": "S04TP"}]}, {"servicetype": [{"servicetype": "Tree Removal"}, {"servicecode": "S0459"}]}, {"servicetype": [{"servicetype": "Tree Trimming"}, {"servicecode": "S0460"}]}, {"servicetype": [{"servicetype": "Utility Cuts Repair"}, {"servicecode": "S0466"}]}, {"servicetype": [{"servicetype": "Vacant Lot"}, {"servicecode": "S0471"}]}, {"servicetype": [{"servicetype": "Yard Waste Collection"}, {"servicecode": "S0476"}]}]} That is not a very sane looking JSON structure. Admittedly it's considered good practice to return objects and not lists, but still I would expect: {"servicetypeslist": [{"name": "Abandoned Bicycles", "code": "S0021"}, ...]} Really what they give is just kind of crazy... -- Ian Bicking | http://blog.ianbicking.org | http://topplabs.org/civichacker -
From: Jeff Hammel
Subject: Re: DC API
Date: Jun 22, 2009 06:22 PM
I was noticing that myself. I assume it that this JSON is either flexible or not finished yes, because this looks pretty crazy On Mon, Jun 22, 2009 at 03:52:16PM -0500, Ian Bicking wrote: > OK, this is just weird; you get this list of descriptions: > [1]http://api.dc.gov/open311/v1/meta_getTypesList.json� > And this is the result: > {"servicetypeslist":�[{"servicetype":�[{"servicetype":�"Abandoned�Bicycles"},�{"servicecode":�"S0021"}]},�{"servicetype":�[{"servicetype":�"Abandoned�Vehicles"},�{"servicecode":�"S0000"}]},�{"servicetype":�[{"servicetype":�"Alley�Cleaning"},�{"servicecode":�"S0011"}]},�{"servicetype":�[{"servicetype":�"Alley�Lights"},�{"servicecode":�"S05AL"}]},�{"servicetype":�[{"servicetype":�"Alley�Repair"},�{"servicecode":�"S0016"}]},�{"servicetype":�[{"servicetype":�"Autumn�Leaf�Collection"},�{"servicecode":�"S0196"}]},�{"servicetype":�[{"servicetype":�"Bulk�Collection"},�{"servicecode":�"S0031"}]},�{"servicetype":�[{"servicetype":�"Curb�&�Gutter�Repair"},�{"servicecode":�"S0081"}]},�{"servicetype":�[{"servicetype":�"Dead�Animal"},�{"servicecode":�"11"}]},�{"servicetype":�[{"servicetype":�"Eviction"},�{"servicecode":�"S0146"}]},�{"servicetype":�[{"servicetype":�"Graffiti"},�{"servicecode":�"GRAFF"}]},�{"servicetype":�[{"servicetype":�"Grass�&�Weeds�Mowing"},�{"servicecode":�"S0166"}]},�{"servicetype":�[{"servicetype"> :�"How�Am�I�Driving?�(Complaint)"},�{"servicecode":�"HMDCP"}]},�{"servicetype":�[{"servicetype":�"How�Am�I�Driving?�(Compliment)"},�{"servicecode":�"HMDCM"}]},�{"servicetype":�[{"servicetype":�"Illegal�Dumping"},�{"servicecode":�"S0181"}]},�{"servicetype":�[{"servicetype":�"Litter�Can�Service�or�Repair"},�{"servicecode":�"S0217"}]},�{"servicetype":�[{"servicetype":�"Parking�Enforcement"},�{"servicecode":�"S0261"}]},�{"servicetype":�[{"servicetype":�"Parking�Meter�Damage"},�{"servicecode":�"S0277"}]},�{"servicetype":�[{"servicetype":�"Parking�Meter�Repair"},�{"servicecode":�"S0276"}]},�{"servicetype":�[{"servicetype":�"Parking�Meters"},�{"servicecode":�"0"}]},�{"servicetype":�[{"servicetype":�"Pavement�Markings"},�{"servicecode":�"S0291"}]},�{"servicetype":�[{"servicetype":�"Potholes"},�{"servicecode":�"S0301"}]},�{"servicetype":�[{"servicetype":�"Rat�Abatement"},�{"servicecode":�"S0311"}]},�{"servicetype":�[{"servicetype":�"Recycling�Bin"},�{"servicecode":�"S0316"}]},�{"servicetype":�[{"servicetype":�"Recycl> ing�Collection"},�{"servicecode":�"S0321"}]},�{"servicetype":�[{"servicetype":�"Residential�Parking�Permit"},�{"servicecode":�"RPP"}]},�{"servicetype":�[{"servicetype":�"Sanitation�Enforcement"},�{"servicecode":�"S0346"}]},�{"servicetype":�[{"servicetype":�"ServiceType"},�{"servicecode":�"ServiceCode"}]},�{"servicetype":�[{"servicetype":�"Sidewalk�Repair"},�{"servicecode":�"S0361"}]},�{"servicetype":�[{"servicetype":�"Signs�-�Parking"},�{"servicecode":�"S0286"}]},�{"servicetype":�[{"servicetype":�"Signs�-�Street�Name"},�{"servicecode":�"S0371"}]},�{"servicetype":�[{"servicetype":�"Street�Cleaning"},�{"servicecode":�"S0391"}]},�{"servicetype":�[{"servicetype":�"Street�Repair"},�{"servicecode":�"S0406"}]},�{"servicetype":�[{"servicetype":�"Streetlight�Repair"},�{"servicecode":�"S05SL"}]},�{"servicetype":�[{"servicetype":�"Supercan"},�{"servicecode":�"S0421"}]},�{"servicetype":�[{"servicetype":�"Traffic�Signals"},�{"servicecode":�"S0436"}]},�{"servicetype":�[{"servicetype":�"Traffic�Signs"},�{"servicecode":�"S0> 376"}]},�{"servicetype":�[{"servicetype":�"Trash�Collection"},�{"servicecode":�"S0441"}]},�{"servicetype":�[{"servicetype":�"Tree�Emergency"},�{"servicecode":�"S0457"}]},�{"servicetype":�[{"servicetype":�"Tree�Maintenance"},�{"servicecode":�"S0456"}]},�{"servicetype":�[{"servicetype":�"Tree�Planting"},�{"servicecode":�"S04TP"}]},�{"servicetype":�[{"servicetype":�"Tree�Removal"},�{"servicecode":�"S0459"}]},�{"servicetype":�[{"servicetype":�"Tree�Trimming"},�{"servicecode":�"S0460"}]},�{"servicetype":�[{"servicetype":�"Utility�Cuts�Repair"},�{"servicecode":�"S0466"}]},�{"servicetype":�[{"servicetype":�"Vacant�Lot"},�{"servicecode":�"S0471"}]},�{"servicetype":�[{"servicetype":�"Yard�Waste�Collection"},�{"servicecode":�"S0476"}]}]} > That is not a very sane looking JSON structure. �Admittedly it's > considered good practice to return objects and not lists, but still I > would expect: > {"servicetypeslist": [{"name": "Abandoned Bicycles", "code": "S0021"}, > ...]} > Really what they give is just kind of crazy... > > -- > Ian Bicking �| �[2]http://blog.ianbicking.org �| > �[3]http://topplabs.org/civichacker > > -- > Archive: [4]http://lists.open311.org/[...]/1245703958256 > To unsubscribe send an email with subject "unsubscribe" to > [5]discuss@.... Please contact > [6]discuss-manager@... for questions. > > References > > Visible links > 1. http://api.dc.gov/open311/v1/meta_getTypesList.json > 2. http://blog.ianbicking.org/ > 3. http://topplabs.org/civichacker > 4. http://lists.open311.org/discuss/archive/2009/06/1245703958256 > 5. mailto:discuss@... > 6. mailto:discuss-manager@...
text.html (text/html) 7.1 kB