Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Node.js module for interacting with the Open311 API.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 createrequest.js
Octocat-spinner-32 getrequest.js
Octocat-spinner-32 listservices.js
Octocat-spinner-32 package.json
Octocat-spinner-32 readme.markdown
Octocat-spinner-32 servicediscovery.js
readme.markdown

Overview

A Node.js module for interacting with the Open311 API (version 2). See Open311.org

Installation

npm install open311

Usage

var util = require('util');
var Open311 = require('./lib/open311').Open311;

//Options for the City of Baltimore (see http://311test.baltimorecity.gov/open311).
var options = {
        'endpoint': '311test.baltimorecity.gov',
        'service_path': '/open311/v2/',
        'jurisdiction_id': 'baltimorecity.gov'
        };

// Create a new Open311 object.
var report = new Open311(options);

// Call getServiceRequest to get the status of a specific request.
report.getServiceRequest('json', '4e6cbd2a9dc2f112940000bc', function(error, data) {    
    util.puts(util.inspect(data));  
});

Output

[
    {
        "token": "4e6cbd2a9dc2f112940000bc",
        "status": "submitted",
        "service_name": "Graffiti Removal",
        "service_code": "4e39a3aad3e2c20ed800000c",
        "requested_datetime": "2011-09-11T09:52:43-04:00",
        "updated_datetime": "2011-09-11T09:52:43-04:00",
        "lat": 39.3257703014457,
        "long": -76.5906496206646,
        "media_url": "http://311test.baltimorecity.gov/attachments/report/4e6cbd2a9dc2f112940000bc/photo/395284434.jpg"
    }
]
Something went wrong with that request. Please try again.